line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Money::ChangeMaker::Presets; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5; |
4
|
7
|
|
|
7
|
|
39
|
use strict; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
235
|
|
5
|
7
|
|
|
7
|
|
38
|
use Money::ChangeMaker::Denomination; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
2047
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my $ret = undef; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _gen_presets_hash { |
10
|
7
|
50
|
|
7
|
|
39
|
return $ret if $ret; |
11
|
|
|
|
|
|
|
# Read the data from the POD! TorgoX++ |
12
|
|
|
|
|
|
|
|
13
|
7
|
|
|
|
|
13
|
my $data; |
14
|
|
|
|
|
|
|
{ |
15
|
7
|
|
|
|
|
14
|
local $/; |
|
7
|
|
|
|
|
38
|
|
16
|
7
|
|
|
|
|
172
|
$data = ; |
17
|
|
|
|
|
|
|
} |
18
|
7
|
|
|
|
|
203
|
for my $section (split(/=head/, $data)) { |
19
|
105
|
100
|
|
|
|
497
|
next unless $section =~ /^2 (\S+).*?Value +Name +Plural\s*-+\n(.*)/s; |
20
|
42
|
|
|
|
|
84
|
my $ref = []; |
21
|
42
|
|
|
|
|
134
|
$ret->{$1} = $ref; |
22
|
42
|
|
|
|
|
293
|
for my $line (split(/\n/, $2)) { |
23
|
483
|
|
|
|
|
1655
|
$line =~ s/^\s+//; |
24
|
483
|
|
|
|
|
1992
|
my @elements = split(/ {2,}/, $line); |
25
|
483
|
|
|
|
|
1072
|
push(@{$ref}, new Money::ChangeMaker::Denomination(@elements)); |
|
483
|
|
|
|
|
1809
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
7
|
|
|
|
|
67
|
return $ret; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__DATA__ |