line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
87628
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
13
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
5
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
8
|
1
|
|
|
1
|
|
769
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
9
|
1
|
|
|
1
|
|
5
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
10
|
1
|
|
|
1
|
|
1326
|
|
|
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(if_array_ref => sub {+{@{$_[0]}}}); |
17
|
1
|
|
|
1
|
|
10
|
} |
18
|
1
|
|
|
1
|
|
15
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=pod |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Catmandu::Fix::hash - creates a hash out of an array |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# tags => ['name', 'Peter', 'age', 12] |
31
|
|
|
|
|
|
|
hash(tags) |
32
|
|
|
|
|
|
|
# tags => {name => 'Peter', age => 12} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
This fix functions transforms array fields to hashes. The number of array |
37
|
|
|
|
|
|
|
elements must be even and fields to be used as field values must be simple |
38
|
|
|
|
|
|
|
strings. String fields and hash fields are left unchanged. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SEE ALSO |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
L<Catmandu::Fix::array>, L<Catmandu::Fix> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |