line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
89010
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
7
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
663
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
9
|
1
|
|
|
1
|
|
6
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
10
|
1
|
|
|
1
|
|
601
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
as_path($self->path)->updater( |
17
|
4
|
|
|
4
|
|
28
|
if => [ |
18
|
|
|
|
|
|
|
array_ref => sub {scalar @{$_[0]}}, |
19
|
|
|
|
|
|
|
hash_ref => sub {scalar keys %{$_[0]}}, |
20
|
1
|
|
|
1
|
|
2
|
], |
|
1
|
|
|
|
|
16
|
|
21
|
2
|
|
|
2
|
|
2
|
); |
|
2
|
|
|
|
|
34
|
|
22
|
4
|
|
|
|
|
16
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Catmandu::Fix::count - replace the value of an array or hash field with its count |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# e.g. tags => ["foo", "bar"] |
36
|
|
|
|
|
|
|
count(tags) # tags => 2 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SEE ALSO |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
L<Catmandu::Fix> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |