line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
2
|
|
|
2
|
|
92206
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
2
|
|
|
2
|
|
13
|
use Catmandu::Util::Path qw(as_path); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
8
|
2
|
|
|
2
|
|
1270
|
use Catmandu::Util::Regex qw(substituter); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
119
|
|
9
|
2
|
|
|
2
|
|
831
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
114
|
|
10
|
2
|
|
|
2
|
|
11
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
12
|
|
11
|
2
|
|
|
2
|
|
1006
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
12
|
|
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
|
|
25
|
->updater(if_value => substituter($self->search, $self->replace)); |
21
|
3
|
|
|
|
|
11
|
} |
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 |