API/Paginator/Compiler.pm

filter: Statementstmt 99.4% 185 / 186 Branchbran 61.5% 48 / 78 Conditioncond 36.0% 18 / 50 MC/DCmcdc 0.0% 0 / 30 Subroutinesub 100% 21 / 21 Podpod 100% 2 / 2 totaltotal 74.6% 274 / 367 CC 69 SCAR 24.9
CC
69
Cov
80%
_resolve_output_shape
31.8
_validate_request_member
17.6
_compile_definition
9.0
CRAP 12.1
« API/Paginator.pm ↑ Summary API/Role/ModuleNames.pm »
1 package Amazon::API::Paginator::Compiler;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent qw(Class::Accessor::Fast);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use English qw(-no_match_vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Scalar::Util qw(reftype);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 our $VERSION = '2.8.2'; ## no critic (RequireInterpolationOfMetachars)
15  
16 1 Readonly::Hash my %RESULT_VERB_FOR_TYPE => (
17 integer => 'add',
18 list => 'append',
19 map => 'first',
20 string => 'concat',
21 structure => 'first',
22 );
23  
24 1 Readonly::Hash my %PAGINATOR_FIELDS => (
25 input_token => 1,
26 limit_key => 1,
27 more_results => 1,
28 non_aggregate_keys => 1,
29 output_token => 1,
30 result_key => 1,
31 );
32  
33 1 Readonly::Hash my %PAGINATOR_ROOT_FIELDS => (
34 pagination => 1,
35 version => 1,
36 );
37  
38 1 __PACKAGE__->follow_best_practice;
39 1 __PACKAGE__->mk_accessors(qw(operations shapes));
40  
41 ########################################################################
42 1 ▶sub new {
Subroutine new: called CC=6 SCAR=20.3
Pod documented
43 ########################################################################
44 1 my ( $class, @options ) = @_;
45  
46 0 ▶ my %options = ref $options[0] ? %{ $options[0] } : @options;
Branch: 1 branch
BranchTrueFalseTotal
ref $options[0] ? : 0 1 1
47  
48 1 foreach my $key (qw(operations shapes)) {
49 2 my $value = $options{$key};
50  
51 2 ▶ croak "$key is required"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 2 2
52 if !defined $value;
53  
54 2 ▶ croak "$key must be a hash reference"
Branch: 1 branch
BranchTrueFalseTotal
if not ref $value or builtin::reftype($value) ne "HASH" 0 2 2
Condition33%1/3
not ref $value or builtin::reftype($value) ne "HASH"
l!l&&r!l&&!r
002
MC/DC0%0/2
not ref $value or builtin::reftype($value) ne "HASH"
not ref $value builtin::reftype($value) ne "HASH"
Truth table33%1/3
not(A) or B
A= not ref $valueB= builtin::reftype($value) ne "HASH"
ABresult
1X1
011
000
55 if !ref $value || reftype($value) ne 'HASH';
56 }
57  
58 1 return $class->SUPER::new( \%options );
59 }
60  
61 ########################################################################
62 7 ▶sub compile {
Subroutine compile: called CC=6 SCAR=18.2
Pod documented
63 ########################################################################
64 7 my ( $self, $paginators ) = @_;
65  
66 return {}
67 7 ▶ if !defined $paginators;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $paginators 0 7 7
68  
69 7 $self->_check_hash( $paginators, 'paginators' );
70  
71 7 foreach my $field ( keys %{$paginators} ) {
72 croak "unsupported paginator root field: $field"
73 8 ▶ if !$PAGINATOR_ROOT_FIELDS{$field};
Branch: 1 branch
BranchTrueFalseTotal
unless $PAGINATOR_ROOT_FIELDS{$field} 0 8 8
74 }
75  
76 return {}
77 7 ▶ if !defined $paginators->{pagination};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $paginators->{"pagination"} 0 7 7
78  
79 7 $self->_check_hash( $paginators->{pagination}, 'pagination' );
80  
81 7 my %compiled;
82  
83 7 foreach my $action ( sort keys %{ $paginators->{pagination} } ) {
84 7 $compiled{$action} = $self->_compile_definition( $action, $paginators->{pagination}->{$action}, );
85 }
86  
87 4 return \%compiled;
88 }
89  
90 ########################################################################
91 7 ▶sub _compile_definition {
Subroutine _compile_definition: called CC=9 SCAR=22.0
92 ########################################################################
93 7 my ( $self, $action, $paginator ) = @_;
94  
95 7 $self->_check_hash( $paginator, "$action paginator" );
96  
97 croak "unknown operation for paginator: $action"
98 7 ▶ if !$self->get_operations->{$action};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->get_operations->{$action} 0 7 7
99  
100 7 foreach my $field ( keys %{$paginator} ) {
101 croak "unsupported paginator field for $action: $field"
102 26 ▶ if !$PAGINATOR_FIELDS{$field};
Branch: 1 branch
BranchTrueFalseTotal
unless $PAGINATOR_FIELDS{$field} 1 25 26
103 }
104  
105 6 foreach my $field (qw(input_token output_token result_key)) {
106 croak "paginator for $action is missing $field"
107 18 ▶ if !exists $paginator->{$field};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $paginator->{$field} 0 18 18
108 }
109  
110 my $definition = {
111 results => $self->_compile_results( $action, $paginator->{result_key} ),
112 6 tokens => $self->_compile_tokens( $action, $paginator->{input_token}, $paginator->{output_token}, ),
113 };
114  
115 4 ▶ if ( exists $paginator->{more_results} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $paginator->{"more_results"}) 2 2 4
116 $definition->{continuation}
117 2 = $self->_compile_expression( $action, $paginator->{more_results}, 'more_results' );
118 }
119  
120 4 ▶ if ( exists $paginator->{limit_key} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $paginator->{"limit_key"}) 1 3 4
121 1 $self->_validate_request_member( $action, $paginator->{limit_key}, 'limit_key' );
122 1 $definition->{limit} = $paginator->{limit_key};
123 }
124  
125 4 ▶ if ( exists $paginator->{non_aggregate_keys} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $paginator->{"non_aggregate_keys"}) 2 2 4
126 $definition->{preserve}
127 2 = $self->_compile_preserve( $action, $paginator->{non_aggregate_keys} );
128 }
129  
130 4 return $definition;
131 }
132  
133 ########################################################################
134 6 ▶sub _compile_tokens {
Subroutine _compile_tokens: called CC=3 SCAR=11.0
135 ########################################################################
136 6 my ( $self, $action, $input_token, $output_token ) = @_;
137  
138 6 my $input_tokens = $self->_as_list( $input_token, "$action input_token" );
139 6 my $output_tokens = $self->_as_list( $output_token, "$action output_token" );
140  
141 croak "paginator for $action has mismatched input/output token counts"
142 6 ▶ if @{$input_tokens} != @{$output_tokens};
Branch: 1 branch
BranchTrueFalseTotal
if @{$input_tokens;} != @{$output_tokens;} 1 5 6
143  
144 5 my @tokens;
145  
146 5 foreach my $idx ( 0 .. $#{$input_tokens} ) {
147 7 my $input = $input_tokens->[$idx];
148  
149 7 $self->_validate_request_member( $action, $input, 'input_token' );
150  
151 7 my $output = $self->_compile_expression( $action, $output_tokens->[$idx], 'output_token', );
152  
153 6 push @tokens,
154 {
155 input => $input,
156 output => $output,
157 };
158 }
159  
160 4 return \@tokens;
161 }
162  
163 ########################################################################
164 6 ▶sub _compile_results {
Subroutine _compile_results: called CC=5 SCAR=16.2
165 ########################################################################
166 6 my ( $self, $action, $result_key ) = @_;
167  
168 6 my $result_keys = $self->_as_list( $result_key, "$action result_key" );
169 6 my %results;
170  
171 6 foreach my $result_key ( @{$result_keys} ) {
172 11 my $expression = $self->_compile_expression( $action, $result_key, 'result_key' );
173 11 my $selectors = $expression->{selectors};
174  
175 croak "result_key for $action must resolve to one selector path: $result_key"
176 11 ▶ if @{$selectors} != 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$selectors;} != 1 0 11 11
177  
178 11 my $selector = $selectors->[0];
179 11 my $shape = $self->_resolve_output_shape( $action, $selector, 'result_key' );
180 11 ▶ my $type = $shape->{type} // q{};
Condition50%1/2
$shape->{"type"} // ""
l!l
110
MC/DC0%0/1
$shape->{"type"} // ""
$shape->{"type"}
Truth table50%1/2
A
A= $shape->{"type"}
Aresult
11
00
181 11 my $verb = $RESULT_VERB_FOR_TYPE{$type};
182  
183 11 ▶ croak "unsupported result type for $action result_key $result_key: $type"
Branch: 1 branch
BranchTrueFalseTotal
unless $verb 0 11 11
184 if !$verb;
185  
186 11 push @{ $results{$verb} }, $selector;
187 }
188  
189 6 return \%results;
190 }
191  
192 ########################################################################
193 2 ▶sub _compile_preserve {
Subroutine _compile_preserve: called CC=3 SCAR=11.0
194 ########################################################################
195 2 my ( $self, $action, $non_aggregate_keys ) = @_;
196  
197 2 my $keys = $self->_as_list( $non_aggregate_keys, "$action non_aggregate_keys" );
198 2 my @preserve;
199  
200 2 foreach my $key ( @{$keys} ) {
201 2 my $expression = $self->_compile_expression( $action, $key, 'non_aggregate_keys' );
202 2 my $selectors = $expression->{selectors};
203  
204 croak "non_aggregate_key for $action must resolve to one selector path: $key"
205 2 ▶ if @{$selectors} != 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$selectors;} != 1 0 2 2
206  
207 2 push @preserve, $selectors->[0];
208 }
209  
210 2 return \@preserve;
211 }
212  
213 ########################################################################
214 22 ▶sub _compile_expression {
Subroutine _compile_expression: called CC=6 SCAR=18.8
215 ########################################################################
216 22 my ( $self, $action, $expression, $field ) = @_;
217  
218 22 ▶ croak "$field for $action must be a scalar expression"
Branch: 1 branch
BranchTrueFalseTotal
if ref $expression 0 22 22
219 if ref $expression;
220  
221 22 ▶ croak "$field for $action must not be empty"
Branch: 1 branch
BranchTrueFalseTotal
if not defined $expression or $expression eq "" 0 22 22
Condition33%1/3
not defined $expression or $expression eq ""
l!l&&r!l&&!r
0022
MC/DC0%0/2
not defined $expression or $expression eq ""
not defined $expression $expression eq ""
Truth table33%1/3
not(A) or B
A= not defined $expressionB= $expression eq ""
ABresult
1X1
011
000
222 if !defined $expression || $expression eq q{};
223  
224 22 my @paths = split /\s*[|][|]\s*/xsm, $expression, -1;
225 22 my @selectors;
226  
227 22 foreach my $path (@paths) {
228 23 ▶ croak "unsupported empty selector in $action $field: $expression"
Branch: 1 branch
BranchTrueFalseTotal
if $path eq "" 0 23 23
229 if $path eq q{};
230  
231 23 my $selector = $self->_compile_selector_path( $action, $path, $field );
232 22 $self->_resolve_output_shape( $action, $selector, $field );
233  
234 22 push @selectors, $selector;
235 }
236  
237 21 return { selectors => \@selectors };
238 }
239  
240 ########################################################################
241 23 ▶sub _compile_selector_path {
Subroutine _compile_selector_path: called CC=5 SCAR=16.1
242 ########################################################################
243 23 my ( $self, $action, $path, $field ) = @_;
244  
245 23 my @parts = split /[.]/xsm, $path, -1;
246 23 my @selector;
247  
248 23 foreach my $part (@parts) {
249 29 ▶ croak "unsupported selector in $action $field: $path"
Branch: 1 branch
BranchTrueFalseTotal
if $part eq "" 0 29 29
250 if $part eq q{};
251  
252 29 ▶ if ( $part !~ /^([^\[\]\s]+)((?:\[-?\d+\])*)$/xsm ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($part =~ /^([^\[\]\s]+)((?:\[-?\d+\])*)$/msx) 1 28 29
253 1 croak "unsupported selector in $action $field: $path";
254 }
255  
256 28 my $member = $1;
257 28 my $indexes = $2;
258  
259 28 push @selector, $member;
260  
261 28 ▶ while ( $indexes =~ /\[(-?\d+)\]/xsmg ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($indexes =~ /\[(-?\d+)\]/gmsx) 2 28 30
262 2 push @selector, { index => 0 + $1 };
263 }
264 }
265  
266 22 return \@selector;
267 }
268  
269 ########################################################################
270 33 ▶sub _resolve_output_shape {
Subroutine _resolve_output_shape: called CC=18 SCAR=34.6
271 ########################################################################
272 33 my ( $self, $action, $selector, $field ) = @_;
273  
274 33 my $operation = $self->get_operations->{$action};
275 33 my $shape_ref = $operation->{output};
276  
277 croak "operation $action has no output shape for paginator $field"
278 33 ▶ if !$shape_ref || !$shape_ref->{shape};
Branch: 1 branch
BranchTrueFalseTotal
unless $shape_ref and $shape_ref->{"shape"} 0 33 33
Condition33%1/3
$shape_ref and $shape_ref->{"shape"}
!ll&&!rl&&r
0033
MC/DC0%0/2
$shape_ref and $shape_ref->{"shape"}
$shape_ref $shape_ref->{"shape"}
Truth table33%1/3
A and B
A= $shape_refB= $shape_ref->{"shape"}
ABresult
0X0
100
111
279  
280 33 my $shape_name = $shape_ref->{shape};
281 33 my $shape = $self->_shape( $shape_name, $action, $field );
282  
283 33 foreach my $step ( @{$selector} ) {
284 42 ▶ if ( !ref $step ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $step) 40 2 42
285 40 ▶ my $type = $shape->{type} // q{};
Condition50%1/2
$shape->{"type"} // ""
l!l
400
MC/DC0%0/1
$shape->{"type"} // ""
$shape->{"type"}
Truth table50%1/2
A
A= $shape->{"type"}
Aresult
11
00
286  
287 40 ▶ croak "cannot select member $step from $type shape $shape_name for $action $field"
Branch: 1 branch
BranchTrueFalseTotal
if $type ne "structure" and $type ne "union" 0 40 40
Condition33%1/3
$type ne "structure" and $type ne "union"
!ll&&!rl&&r
4000
MC/DC0%0/2
$type ne "structure" and $type ne "union"
$type ne "structure" $type ne "union"
Truth table33%1/3
A and B
A= $type ne "structure"B= $type ne "union"
ABresult
0X0
100
111
288 if $type ne 'structure' && $type ne 'union';
289  
290 40 ▶ my $member = $shape->{members} && $shape->{members}->{$step};
Condition33%1/3
$shape->{'members'} && $shape->{'members'}{$step}
!ll&&!rl&&r
0040
MC/DC0%0/2
$shape->{'members'} && $shape->{'members'}{$step}
$shape->{'members'} $shape->{'members'}{$step}
Truth table33%1/3
A && B
A= $shape->{'members'}B= $shape->{'members'}{$step}
ABresult
0X0
100
111
291  
292 croak "unknown member $step in shape $shape_name for $action $field"
293 40 ▶ if !$member || !$member->{shape};
Branch: 1 branch
BranchTrueFalseTotal
unless $member and $member->{"shape"} 0 40 40
Condition33%1/3
$member and $member->{"shape"}
!ll&&!rl&&r
0040
MC/DC0%0/2
$member and $member->{"shape"}
$member $member->{"shape"}
Truth table33%1/3
A and B
A= $memberB= $member->{"shape"}
ABresult
0X0
100
111
294  
295 40 $shape_name = $member->{shape};
296 40 $shape = $self->_shape( $shape_name, $action, $field );
297 40 next;
298 }
299  
300 croak "invalid selector step for $action $field"
301 2 ▶ if reftype($step) ne 'HASH' || !exists $step->{index} || keys %{$step} != 1;
Branch: 1 branch
BranchTrueFalseTotal
if builtin::reftype($step) ne "HASH" or not exists $step->{"index"} or keys %{$step;} != 1 0 2 2
Condition33%2/6
builtin::reftype($step) ne "HASH" or not exists $step->{"index"} or keys %{$step;} != 1
l!l&&r!l&&!r
002
builtin::reftype($step) ne "HASH" or not exists $step->{"index"}
l!l&&r!l&&!r
002
MC/DC0%0/3
builtin::reftype($step) ne "HASH" or not exists $step->{"index"} or keys %{$step;} != 1
builtin::reftype($step) ne "HASH" not exists $step->{"index"} keys %{$step;} != 1
Truth table25%1/4
A or not(B) or C
A= builtin::reftype($step) ne "HASH"B= not exists $step->{"index"}C= keys %{$step;} != 1
ABCresult
1XX1
01X1
0011
0000
302  
303 croak "cannot index non-list shape $shape_name for $action $field"
304 2 ▶ if ( $shape->{type} // q{} ) ne 'list';
Branch: 1 branch
BranchTrueFalseTotal
if ($shape->{"type"} // "") ne "list" 0 2 2
Condition50%1/2
$shape->{"type"} // ""
l!l
20
MC/DC0%0/1
$shape->{"type"} // ""
$shape->{"type"}
Truth table50%1/2
A
A= $shape->{"type"}
Aresult
11
00
305  
306 2 my $member = $shape->{member};
307  
308 croak "list shape $shape_name has no member shape for $action $field"
309 2 ▶ if !$member || !$member->{shape};
Branch: 1 branch
BranchTrueFalseTotal
unless $member and $member->{"shape"} 0 2 2
Condition33%1/3
$member and $member->{"shape"}
!ll&&!rl&&r
002
MC/DC0%0/2
$member and $member->{"shape"}
$member $member->{"shape"}
Truth table33%1/3
A and B
A= $memberB= $member->{"shape"}
ABresult
0X0
100
111
310  
311 2 $shape_name = $member->{shape};
312 2 $shape = $self->_shape( $shape_name, $action, $field );
313 }
314  
315 33 return $shape;
316 }
317  
318 ########################################################################
319 8 ▶sub _validate_request_member {
Subroutine _validate_request_member: called CC=11 SCAR=28.7
320 ########################################################################
321 8 my ( $self, $action, $member_name, $field ) = @_;
322  
323 8 ▶ croak "$field for $action must be a scalar member name"
Branch: 1 branch
BranchTrueFalseTotal
if not defined $member_name or ref $member_name or $member_name eq "" 0 8 8
Condition33%2/6
not defined $member_name or ref $member_name or $member_name eq ""
l!l&&r!l&&!r
008
not defined $member_name or ref $member_name
l!l&&r!l&&!r
008
MC/DC0%0/3
not defined $member_name or ref $member_name or $member_name eq ""
not defined $member_name ref $member_name $member_name eq ""
Truth table25%1/4
not(A) or B or C
A= not defined $member_nameB= ref $member_nameC= $member_name eq ""
ABCresult
1XX1
01X1
0011
0000
324 if !defined $member_name || ref $member_name || $member_name eq q{};
325  
326 8 ▶ croak "nested request member is not supported for $action $field: $member_name"
Branch: 1 branch
BranchTrueFalseTotal
if $member_name =~ /[.\[\]|]/msx 0 8 8
327 if $member_name =~ /[.\[\]|]/xsm;
328  
329 8 my $operation = $self->get_operations->{$action};
330 8 my $shape_ref = $operation->{input};
331  
332 croak "operation $action has no input shape for paginator $field"
333 8 ▶ if !$shape_ref || !$shape_ref->{shape};
Branch: 1 branch
BranchTrueFalseTotal
unless $shape_ref and $shape_ref->{"shape"} 0 8 8
Condition33%1/3
$shape_ref and $shape_ref->{"shape"}
!ll&&!rl&&r
008
MC/DC0%0/2
$shape_ref and $shape_ref->{"shape"}
$shape_ref $shape_ref->{"shape"}
Truth table33%1/3
A and B
A= $shape_refB= $shape_ref->{"shape"}
ABresult
0X0
100
111
334  
335 8 my $shape_name = $shape_ref->{shape};
336 8 my $shape = $self->_shape( $shape_name, $action, $field );
337 8 ▶ my $type = $shape->{type} // q{};
Condition50%1/2
$shape->{"type"} // ""
l!l
80
MC/DC0%0/1
$shape->{"type"} // ""
$shape->{"type"}
Truth table50%1/2
A
A= $shape->{"type"}
Aresult
11
00
338  
339 8 ▶ croak "input shape $shape_name for $action is not a structure"
Branch: 1 branch
BranchTrueFalseTotal
if $type ne "structure" 0 8 8
340 if $type ne 'structure';
341  
342 8 ▶ my $member = $shape->{members} && $shape->{members}->{$member_name};
Condition33%1/3
$shape->{'members'} && $shape->{'members'}{$member_name}
!ll&&!rl&&r
008
MC/DC0%0/2
$shape->{'members'} && $shape->{'members'}{$member_name}
$shape->{'members'} $shape->{'members'}{$member_name}
Truth table33%1/3
A && B
A= $shape->{'members'}B= $shape->{'members'}{$member_name}
ABresult
0X0
100
111
343  
344 8 ▶ croak "unknown request member $member_name in shape $shape_name for $action $field"
Branch: 1 branch
BranchTrueFalseTotal
unless $member 0 8 8
345 if !$member;
346  
347 8 return;
348 }
349  
350 ########################################################################
351 83 ▶sub _shape {
Subroutine _shape: called CC=2 SCAR=7.0
352 ########################################################################
353 83 my ( $self, $shape_name, $action, $field ) = @_;
354  
355 83 my $shape = $self->get_shapes->{$shape_name};
356  
357 83 ▶ croak "unknown shape $shape_name for $action $field"
Branch: 1 branch
BranchTrueFalseTotal
unless $shape 0 83 83
358 if !$shape;
359  
360 83 return $shape;
361 }
362  
363 ########################################################################
364 20 ▶sub _as_list {
Subroutine _as_list: called CC=4 SCAR=14.0
365 ########################################################################
366 20 my ( $self, $value, $name ) = @_;
367  
368 20 ▶ croak "$name is required"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 20 20
369 if !defined $value;
370  
371 20 ▶ if ( !ref $value ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $value) 12 8 20
372 12 return [$value];
373 }
374  
375 8 ▶ croak "$name must be a scalar or array reference"
Branch: 1 branch
BranchTrueFalseTotal
if builtin::reftype($value) ne "ARRAY" 0 8 8
376 if reftype($value) ne 'ARRAY';
377  
378 8 return [ @{$value} ];
379 }
380  
381 ########################################################################
382 21 ▶sub _check_hash {
Subroutine _check_hash: called CC=3 SCAR=12.5
383 ########################################################################
384 21 my ( $self, $value, $name ) = @_;
385  
386 21 ▶ croak "$name must be a hash reference"
Branch: 1 branch
BranchTrueFalseTotal
if not ref $value or builtin::reftype($value) ne "HASH" 0 21 21
Condition33%1/3
not ref $value or builtin::reftype($value) ne "HASH"
l!l&&r!l&&!r
0021
MC/DC0%0/2
not ref $value or builtin::reftype($value) ne "HASH"
not ref $value builtin::reftype($value) ne "HASH"
Truth table33%1/3
not(A) or B
A= not ref $valueB= builtin::reftype($value) ne "HASH"
ABresult
1X1
011
000
387 if !ref $value || reftype($value) ne 'HASH';
388  
389 21 return;
390 }
391  
392 1 1;
393  
394 __END__
« API/Paginator.pm ↑ Summary API/Role/ModuleNames.pm »