line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::Util::GenericLength; |
2
|
2
|
|
|
2
|
|
3348
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
53
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
252
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/generic_length/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub generic_length { |
10
|
37
|
|
|
37
|
0
|
54
|
my $obj = shift; |
11
|
|
|
|
|
|
|
|
12
|
37
|
100
|
|
|
|
107
|
if (ref $obj eq 'ARRAY') { |
|
|
100
|
|
|
|
|
|
13
|
16
|
|
|
|
|
46
|
return scalar @$obj; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
elsif (ref $obj eq 'HASH') { |
17
|
4
|
|
|
|
|
17
|
return scalar keys %$obj; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
17
|
|
|
|
|
45
|
return length $obj; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |