| 1 | package Net::Amazon::DynamoDB::Marshaler; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use 5.008_005; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | our $VERSION = '0.06'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use parent qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | our @EXPORT = qw(dynamodb_marshal dynamodb_unmarshal); | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use boolean qw(true false isBoolean); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Types::Standard qw(StrictNum); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub dynamodb_marshal { | ||||||||||||||||||||||||||||
| 15 | 25 | ▶ | my ($attrs, %args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dynamodb_marshal: called CC=7 SCAR=21.5
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 25 | ▶ | my $force_type = $args{force_type} || {}; | ||||||||||||||||||||||||||
|
Condition100%2/2
$args{'force_type'} || {}
MC/DC100%1/1
$args{'force_type'} || {}
$args{'force_type'}
Truth table100%2/2
A
A= $args{'force_type'}
| |||||||||||||||||||||||||||||
| 17 | 25 | ▶ | die __PACKAGE__.'::dynamodb_marshal(): argument must be a hashref' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $attrs and ref $attrs eq "HASH"
MC/DC0%0/2
ref $attrs and ref $attrs eq "HASH"
ref $attrs
ref $attrs eq "HASH"
Truth table33%1/3
A and B
A= ref $attrsB= ref $attrs eq "HASH"
| |||||||||||||||||||||||||||||
| 18 | unless ( | ||||||||||||||||||||||||||||
| 19 | ref $attrs | ||||||||||||||||||||||||||||
| 20 | && ref $attrs eq 'HASH' | ||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||
| 22 | 25 | ▶ | die __PACKAGE__.'::dynamodb_marshal(): force_type must be a hashref' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $force_type and ref $force_type eq "HASH"
MC/DC0%0/2
ref $force_type and ref $force_type eq "HASH"
ref $force_type
ref $force_type eq "HASH"
Truth table33%1/3
A and B
A= ref $force_typeB= ref $force_type eq "HASH"
| |||||||||||||||||||||||||||||
| 23 | unless ( | ||||||||||||||||||||||||||||
| 24 | ref $force_type | ||||||||||||||||||||||||||||
| 25 | && ref $force_type eq 'HASH' | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | die __PACKAGE__.qq|::dynamodb_marshal(): invalid force_type value for "$_"| | ||||||||||||||||||||||||||||
| 29 | 25 | for grep { | |||||||||||||||||||||||||||
| 30 | 19 | $force_type->{$_} !~ /^[SN]$/; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | keys %$force_type; | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 24 | return _marshal_hashref($attrs, $force_type); | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | sub dynamodb_unmarshal { | ||||||||||||||||||||||||||||
| 38 | 9 | ▶ | my ($attrs) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dynamodb_unmarshal: called CC=3 SCAR=12.5
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 9 | ▶ | die __PACKAGE__.'::dynamodb_unmarshal(): argument must be a hashref' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $attrs and ref $attrs eq "HASH"
MC/DC0%0/2
ref $attrs and ref $attrs eq "HASH"
ref $attrs
ref $attrs eq "HASH"
Truth table33%1/3
A and B
A= ref $attrsB= ref $attrs eq "HASH"
| |||||||||||||||||||||||||||||
| 40 | unless ( | ||||||||||||||||||||||||||||
| 41 | ref $attrs | ||||||||||||||||||||||||||||
| 42 | && ref $attrs eq 'HASH' | ||||||||||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||||||||||
| 44 | 9 | return _unmarshal_hashref($attrs); | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | sub _marshal_hashref { | ||||||||||||||||||||||||||||
| 48 | 36 | ▶ | my ($attrs, $force_types) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_marshal_hashref: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 49 | 36 | ▶ | $force_types ||= {}; | ||||||||||||||||||||||||||
|
Condition50%1/2
$force_types ||= {}
MC/DC0%0/1
$force_types ||= {}
$force_types
Truth table50%1/2
A
A= $force_types
| |||||||||||||||||||||||||||||
| 50 | 36 | my %marshalled; | |||||||||||||||||||||||||||
| 51 | 36 | for my $key (keys %$attrs) { | |||||||||||||||||||||||||||
| 52 | 111 | my $val = $attrs->{$key}; | |||||||||||||||||||||||||||
| 53 | 111 | my $force_type = $force_types->{$key}; | |||||||||||||||||||||||||||
| 54 | 111 | my $new_val = _marshal_val($val, $force_type); | |||||||||||||||||||||||||||
| 55 | 107 | ▶ | if ($new_val) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | 100 | $marshalled{$key} = $new_val; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | 32 | return \%marshalled; | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | sub _unmarshal_hashref { | ||||||||||||||||||||||||||||
| 63 | 14 | ▶ | my ($attrs) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_unmarshal_hashref: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 64 | 14 | return { map { $_ => _unmarshal_attr_val($attrs->{$_}) } keys %$attrs }; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | sub _marshal_val { | ||||||||||||||||||||||||||||
| 68 | 144 | ▶ | my ($val, $force_type) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_marshal_val: called CC=19 SCAR=29.4
| |||||||||||||||||||||||||||||
| 69 | 144 | ▶ | $force_type ||= ''; | ||||||||||||||||||||||||||
|
Condition100%2/2
$force_type ||= ""
MC/DC100%1/1
$force_type ||= ""
$force_type
Truth table100%2/2
A
A= $force_type
| |||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | # Calculate the type according to our rules. | ||||||||||||||||||||||||||||
| 72 | 144 | my $type = _val_type($val); | |||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | # Subref to build string value result | ||||||||||||||||||||||||||||
| 75 | 142 | ▶ | my $marshalled_string = sub {{ S => "$_[0]" }}; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | # Subref to build number value result | ||||||||||||||||||||||||||||
| 78 | 142 | ▶ | my $marshalled_num = sub {{ N => $_[0] }}; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | # Handle strings | ||||||||||||||||||||||||||||
| 81 | 142 | ▶ | if ($type eq 'S') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 82 | # Strip these out if we're force-typing to number | ||||||||||||||||||||||||||||
| 83 | 39 | ▶ | if ($force_type eq 'N') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 84 | 3 | return undef; | |||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | 36 | return $marshalled_string->($val); | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | # Handle numbers | ||||||||||||||||||||||||||||
| 90 | 103 | ▶ | if ($type eq 'N') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 91 | # Force-stringify if asked | ||||||||||||||||||||||||||||
| 92 | 42 | ▶ | if ($force_type eq 'S') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 93 | 9 | return $marshalled_string->($val); | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | 33 | return $marshalled_num->($val); | |||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | # Handle nulls | ||||||||||||||||||||||||||||
| 99 | 61 | ▶ | if ($type eq 'NULL') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | # Strip these out if we're force-typing | ||||||||||||||||||||||||||||
| 101 | 14 | ▶ | if ($force_type) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | 7 | return undef; | |||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | 7 | return { NULL => 1 }; | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | # Handle booleans | ||||||||||||||||||||||||||||
| 108 | 47 | ▶ | if ($type eq 'BOOL') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 109 | # Force-stringify if asked | ||||||||||||||||||||||||||||
| 110 | 12 | ▶ | if ($force_type eq 'S') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 111 | 2 | ▶ | return $marshalled_string->($val ? 1 : 0); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||
| 113 | # Force-numerify if asked | ||||||||||||||||||||||||||||
| 114 | 10 | ▶ | if ($force_type eq 'N') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 115 | 2 | ▶ | return $marshalled_num->($val ? 1 : 0); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||
| 117 | 8 | ▶ | return { BOOL => $val ? 1 : 0 }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | # Handle sets | ||||||||||||||||||||||||||||
| 121 | 35 | ▶ | if ($type =~ /^(NS|SS)$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 122 | # Blow up trying to force-type a set | ||||||||||||||||||||||||||||
| 123 | 11 | ▶ | die __PACKAGE__.'force_type not supported for sets yet' | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | if $force_type; | ||||||||||||||||||||||||||||
| 125 | 9 | return { $type => [ $val->members ] }; | |||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | # Handle lists | ||||||||||||||||||||||||||||
| 129 | 24 | ▶ | if ($type eq 'L') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 130 | 12 | my @items = map { _marshal_val($_, $force_type) } @$val; | |||||||||||||||||||||||||||
| 131 | # Strip out any values that failed force-typing | ||||||||||||||||||||||||||||
| 132 | 12 | @items = grep { defined } @items; | |||||||||||||||||||||||||||
| 133 | 12 | return { L => \@items }; | |||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | # Handle maps | ||||||||||||||||||||||||||||
| 137 | 12 | ▶ | if ($type eq 'M') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 138 | 12 | my $force_types = {}; | |||||||||||||||||||||||||||
| 139 | 12 | ▶ | if ($force_type) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 140 | # Recursively apply our force type to all values. | ||||||||||||||||||||||||||||
| 141 | 7 | $force_types = { map { $_ => $force_type } keys %$val }; | |||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||
| 143 | 12 | return { M => _marshal_hashref($val, $force_types) }; | |||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | 0 | die "don't know how to marshal type of $type"; | |||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | sub _unmarshal_attr_val { | ||||||||||||||||||||||||||||
| 150 | 47 | ▶ | my ($attr_val) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_unmarshal_attr_val: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||
| 151 | 47 | my ($type, $val) = %$attr_val; | |||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | 47 | ▶ | return undef if $type eq 'NULL'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 154 | 45 | ▶ | return $val if $type =~ /^(S|N)$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | 20 | ▶ | return true if $type eq 'BOOL' && $val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$type eq "BOOL" and $val
MC/DC100%2/2
$type eq "BOOL" and $val
$type eq "BOOL"
$val
Truth table100%3/3
A and B
A= $type eq "BOOL"B= $val
| |||||||||||||||||||||||||||||
| 156 | 18 | ▶ | return false if $type eq 'BOOL'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | 16 | ▶ | return Set::Object->new(@$val) if $type =~ /^(NS|SS)$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 158 | 12 | ▶ | return [ map { _unmarshal_attr_val($_) } @$val ] if $type eq 'L'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | 5 | ▶ | return _unmarshal_hashref($val) if $type eq 'M'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | 0 | die "don't know how to unmarshal $type"; | |||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | sub _val_type { | ||||||||||||||||||||||||||||
| 165 | 178 | ▶ | my ($val) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_val_type: called CC=12 SCAR=24.9
| |||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | 178 | ▶ | return 'NULL' if ! defined $val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 168 | 168 | ▶ | return 'NULL' if $val eq ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 169 | 164 | ▶ | return 'N' if _is_valid_number($val); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 170 | 103 | ▶ | return 'S' if !ref $val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | 50 | ▶ | return 'BOOL' if isBoolean($val); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 38 | my $ref = ref $val; | |||||||||||||||||||||||||||
| 175 | 38 | ▶ | return 'L' if $ref eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 176 | 26 | ▶ | return 'M' if $ref eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 13 | ▶ | if (blessed($val) and $val->isa('Set::Object')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($val) and $val->isa("Set::Object")
MC/DC50%1/2
builtin::blessed($val) and $val->isa("Set::Object")
builtin::blessed($val)
$val->isa("Set::Object")
Truth table66%2/3
A and B
A= builtin::blessed($val)B= $val->isa("Set::Object")
| |||||||||||||||||||||||||||||
| 179 | 12 | my @types = map { _val_type($_) } $val->members; | |||||||||||||||||||||||||||
| 180 | die "Sets can only contain strings and numbers, found $_" | ||||||||||||||||||||||||||||
| 181 | 12 | for grep { !/^(S|N)$/ } @types; | |||||||||||||||||||||||||||
| 182 | 11 | ▶ | if (grep { /^S$/ } @types) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 183 | 5 | return 'SS'; | |||||||||||||||||||||||||||
| 184 | } else { | ||||||||||||||||||||||||||||
| 185 | 6 | return 'NS'; | |||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | 1 | die __PACKAGE__.": unable to marshal value: $val"; | |||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | sub _is_valid_number { | ||||||||||||||||||||||||||||
| 193 | 164 | ▶ | my ($val) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_is_valid_number: called CC=12 SCAR=24.9
| |||||||||||||||||||||||||||||
| 194 | 164 | ▶ | return 0 if ref $val; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 195 | 114 | ▶ | return 0 unless StrictNum->check($val); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | # Some very high numbers are equal to 0, keep those as strings | ||||||||||||||||||||||||||||
| 198 | 68 | ▶ | return 1 if ("$val" eq '0'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 199 | 68 | ▶ | return 0 if ($val == 0); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | 68 | ▶ | return 0 if ($val > 0 && $val <= 1e-130); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$val > 0 and $val <= "1e-130"
MC/DC100%2/2
$val > 0 and $val <= "1e-130"
$val > 0
$val <= "1e-130"
Truth table100%3/3
A and B
A= $val > 0B= $val <= "1e-130"
| |||||||||||||||||||||||||||||
| 202 | 67 | ▶ | return 0 if ($val < 0 && $val >= -1e-130); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$val < 0 and $val >= "-1e-130"
MC/DC100%2/2
$val < 0 and $val >= "-1e-130"
$val < 0
$val >= "-1e-130"
Truth table100%3/3
A and B
A= $val < 0B= $val >= "-1e-130"
| |||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 66 | ▶ | return 0 if ($val >= 1e126); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 205 | 64 | ▶ | return 0 if ($val <= -1e126); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||
| 207 | 63 | ▶ | return 0 if length($val) > 38; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | 61 | return 1; | |||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 1 | 1; | |||||||||||||||||||||||||||
| 214 | __END__ | ||||||||||||||||||||||||||||