line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::ELLEDNERA::Utils;
|
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
287067
|
use 5.006;
|
|
4
|
|
|
|
|
41
|
|
4
|
4
|
|
|
4
|
|
22
|
use strict;
|
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
101
|
|
5
|
4
|
|
|
4
|
|
20
|
use warnings;
|
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
215
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.04';
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
27
|
use Exporter qw(import);
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1140
|
|
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw( sum shuffle );
|
11
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [@EXPORT_OK] );
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub sum {
|
15
|
5
|
|
|
5
|
1
|
646
|
my @valid_nums = grep { /\A-?\d+(?:\.\d+)?\z/ } @_;
|
|
16
|
|
|
|
|
81
|
|
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
|
|
8
|
my $sum;
|
18
|
5
|
|
|
|
|
11
|
for ( @valid_nums ) {
|
19
|
12
|
|
|
|
|
22
|
$sum += $_;
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$sum
|
23
|
5
|
|
|
|
|
23
|
}
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub shuffle {
|
27
|
2
|
|
|
2
|
1
|
1312
|
my @deck = @_;
|
28
|
2
|
100
|
|
|
|
10
|
return unless @deck;
|
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
3
|
my $i = @deck;
|
31
|
1
|
|
|
|
|
5
|
while (--$i) {
|
32
|
7
|
|
|
|
|
54
|
my $j = int rand ($i+1);
|
33
|
7
|
|
|
|
|
26
|
@deck[$i, $j] = @deck[$j, $i];
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
13
|
@deck;
|
37
|
|
|
|
|
|
|
}
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; # End of Acme::ELLEDNERA::Utils
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__
|