line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Unixish::rev; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
500
|
use 5.010; |
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
418
|
use syntax 'each_on_array'; # to support perl < 5.12 |
|
1
|
|
|
|
|
24215
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
3508
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
7
|
|
|
|
|
|
|
#use Log::Any '$log'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
463
|
use Data::Unixish::Util qw(%common_args); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
250
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.571'; # 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
|
|
|
|
|
2
|
my @tmp; |
28
|
1
|
|
|
|
|
15
|
while (my ($index, $item) = each @$in) { |
29
|
10
|
|
|
|
|
25
|
push @tmp, $item; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
11
|
push @$out, pop @tmp while @tmp; |
33
|
1
|
|
|
|
|
4
|
[200, "OK"]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
# ABSTRACT: Reverse items |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |