line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Petal::Utils::Sort; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
153
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings::register; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
477
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
23
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
363
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
23
|
use base qw( Petal::Utils::Base ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1761
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
24
|
use constant name => 'sort'; |
|
4
|
|
|
|
|
24
|
|
|
4
|
|
|
|
|
247
|
|
11
|
4
|
|
|
4
|
|
19
|
use constant aliases => qw(); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
827
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1]; |
14
|
|
|
|
|
|
|
our $REVISION = (split(/ /, ' $Revision: 1.3 $ '))[2]; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub process { |
17
|
1
|
|
|
1
|
0
|
12876
|
my $class = shift; |
18
|
1
|
|
|
|
|
3
|
my $hash = shift; |
19
|
1
|
|
33
|
|
|
5
|
my $args = shift || confess( "'sort' expects an array ref (got nothing)!" ); |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
6
|
my $result = $hash->fetch( $args ); |
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
131
|
confess( "1st arg to 'sort' is not an array ($args = $result)!" ) |
24
|
|
|
|
|
|
|
unless ref($result) eq 'ARRAY'; # ignore object for now |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
10
|
return [ sort @$result ]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |