line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::ClearSilver::FunctionSet; |
2
|
2
|
|
|
2
|
|
2174
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
81
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
68
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use Exporter (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
432
|
|
6
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(usage); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub usage { |
11
|
2
|
|
|
2
|
0
|
16
|
require Carp; |
12
|
2
|
|
|
|
|
469
|
Carp::croak("Usage: @_"); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub load { |
17
|
3
|
|
|
3
|
1
|
1362
|
my($self, $monikers) = @_; |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
7
|
my %set; |
20
|
|
|
|
|
|
|
|
21
|
3
|
100
|
|
|
|
12
|
foreach my $moniker(ref($monikers) ? @{$monikers} : $monikers) { |
|
2
|
|
|
|
|
5
|
|
22
|
5
|
|
|
|
|
13
|
my $module = "Text/ClearSilver/FunctionSet/$moniker.pm"; |
23
|
5
|
|
|
|
|
9
|
$module =~ s{::}{/}g; # $moniker can include '::' |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
9303
|
require $module; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
18
|
my $package = __PACKAGE__ . '::' . $moniker . '::'; |
28
|
5
|
|
|
|
|
8
|
my $stash = do { |
29
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
143
|
|
30
|
5
|
|
|
|
|
8
|
\%{$package}; |
|
5
|
|
|
|
|
19
|
|
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
5
|
|
|
|
|
11
|
while(my $key = each %{$stash}){ |
|
38
|
|
|
|
|
130
|
|
34
|
33
|
100
|
|
|
|
111
|
if($key =~ s/^_function_//){ |
35
|
23
|
|
|
|
|
24
|
$set{$key} = do { |
36
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
174
|
|
37
|
23
|
|
|
|
|
26
|
\&{$package . '_function_' . $key}; |
|
23
|
|
|
|
|
113
|
|
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
3
|
|
|
|
|
81
|
return \%set; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
__END__ |