line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
86871
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
15
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
11
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
8
|
2
|
|
|
2
|
|
609
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
9
|
2
|
|
|
2
|
|
936
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
10
|
|
|
|
|
|
|
with 'Catmandu::Fix::Base'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my ($self, $fixer) = @_; |
15
|
|
|
|
|
|
|
my $path = $fixer->split_path($self->path); |
16
|
8
|
|
|
8
|
0
|
14
|
my $key = pop @$path; |
17
|
8
|
|
|
|
|
29
|
|
18
|
8
|
|
|
|
|
13
|
$fixer->emit_walk_path( |
19
|
|
|
|
|
|
|
$fixer->var, |
20
|
|
|
|
|
|
|
$path, |
21
|
|
|
|
|
|
|
sub { |
22
|
|
|
|
|
|
|
my $var = shift; |
23
|
|
|
|
|
|
|
$fixer->emit_retain_key($var, $key); |
24
|
8
|
|
|
8
|
|
11
|
} |
25
|
8
|
|
|
|
|
22
|
); |
26
|
|
|
|
|
|
|
} |
27
|
8
|
|
|
|
|
133
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Catmandu::Fix::retain_field - delete everything from a field except |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DEPRECIATION NOTICE |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This fix is deprecated, Please use L<Catmandu::Fix::retain> instead. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Delete every key from foo except bar |
44
|
|
|
|
|
|
|
retain_field(foo.bar) |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SEE ALSO |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
L<Catmandu::Fix> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |