line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
86720
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
11
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
12
|
use Catmandu::Util::Path qw(as_path); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
8
|
2
|
|
|
2
|
|
968
|
use Catmandu::Util::Regex qw(substituter); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
101
|
|
9
|
2
|
|
|
2
|
|
770
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
99
|
|
10
|
2
|
|
|
2
|
|
11
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
11
|
2
|
|
|
2
|
|
938
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
12
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
has search => (fix_arg => 1); |
14
|
|
|
|
|
|
|
has replace => (fix_arg => 1); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my ($self) = @_; |
19
|
|
|
|
|
|
|
as_path($self->path) |
20
|
3
|
|
|
3
|
|
51
|
->updater(if_value => substituter($self->search, $self->replace)); |
21
|
3
|
|
|
|
|
12
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Catmandu::Fix::replace_all - search and replace using regex expressions |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Extract a substring out of the value of a field |
35
|
|
|
|
|
|
|
# {author => "tom jones"} |
36
|
|
|
|
|
|
|
replace_all(author, '([^ ]+) ([^ ]+)', '$2, $1') |
37
|
|
|
|
|
|
|
# {author => "jones, tom"} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SEE ALSO |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L<Catmandu::Fix> |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |