line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::reverse; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
107680
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
15
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
805
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
9
|
1
|
|
|
1
|
|
8
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
10
|
1
|
|
|
1
|
|
755
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
5
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _build_fixer { |
17
|
2
|
|
|
2
|
|
33
|
my ($self) = @_; |
18
|
|
|
|
|
|
|
as_path($self->path)->updater( |
19
|
|
|
|
|
|
|
if_array_ref => sub { |
20
|
1
|
|
|
1
|
|
2
|
[reverse(@{$_[0]})]; |
|
1
|
|
|
|
|
19
|
|
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
if_string => sub { |
23
|
1
|
|
|
1
|
|
25
|
scalar(reverse($_[0])); |
24
|
|
|
|
|
|
|
}, |
25
|
2
|
|
|
|
|
9
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Catmandu::Fix::reverse - reverse a string or an array |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# {author => "tom jones"} |
41
|
|
|
|
|
|
|
reverse(author) |
42
|
|
|
|
|
|
|
# {author => "senoj mot"} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# {numbers => [1,14,2]} |
45
|
|
|
|
|
|
|
reverse(numbers) |
46
|
|
|
|
|
|
|
# {numbers => [2,14,1]} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SEE ALSO |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L<Catmandu::Fix> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |