line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Unixish::rev; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
431
|
use 5.010; |
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
332
|
use syntax 'each_on_array'; # to support perl < 5.12 |
|
1
|
|
|
|
|
19280
|
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
2897
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
|
|
|
|
|
|
#use Log::Any '$log'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
359
|
use Data::Unixish::Util qw(%common_args); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
305
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.570'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %SPEC; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$SPEC{rev} = { |
16
|
|
|
|
|
|
|
v => 1.1, |
17
|
|
|
|
|
|
|
summary => 'Reverse items', |
18
|
|
|
|
|
|
|
args => { |
19
|
|
|
|
|
|
|
%common_args, |
20
|
|
|
|
|
|
|
}, |
21
|
|
|
|
|
|
|
tags => [qw/ordering/], |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
sub rev { |
24
|
1
|
|
|
1
|
1
|
3
|
my %args = @_; |
25
|
1
|
|
|
|
|
2
|
my ($in, $out) = ($args{in}, $args{out}); |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
3
|
my @tmp; |
28
|
1
|
|
|
|
|
4
|
while (my ($index, $item) = each @$in) { |
29
|
10
|
|
|
|
|
26
|
push @tmp, $item; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
8
|
push @$out, pop @tmp while @tmp; |
33
|
1
|
|
|
|
|
4
|
[200, "OK"]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
# ABSTRACT: Reverse items |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |