line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package CGI::Application::Plugin::Phrasebook; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
141455
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
113
|
|
5
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
92
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
16
|
use Carp 'confess'; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
195
|
|
8
|
3
|
|
|
3
|
|
16
|
use Scalar::Util 'blessed'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
333
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
7932
|
use CGI::Application; |
|
3
|
|
|
|
|
20559
|
|
|
3
|
|
|
|
|
96
|
|
11
|
3
|
|
|
3
|
|
2839
|
use Data::Phrasebook; |
|
3
|
|
|
|
|
5171
|
|
|
3
|
|
|
|
|
235
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw( |
16
|
|
|
|
|
|
|
config_phrasebook |
17
|
|
|
|
|
|
|
phrasebook |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub import { |
21
|
5
|
|
|
5
|
|
2162
|
my $pkg = shift; |
22
|
5
|
|
|
|
|
10
|
my $call = caller; |
23
|
3
|
|
|
3
|
|
17
|
no strict 'refs'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
725
|
|
24
|
5
|
|
|
|
|
12
|
foreach my $sym (@EXPORT) { |
25
|
10
|
|
|
|
|
34
|
*{"${call}::$sym"} = \&{$sym}; |
|
10
|
|
|
|
|
4400
|
|
|
10
|
|
|
|
|
19
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub config_phrasebook { |
30
|
6
|
|
|
6
|
1
|
82033
|
my $self = shift; |
31
|
6
|
100
|
|
|
|
31
|
unless (ref($_[0])) { |
32
|
2
|
|
|
|
|
21
|
$self->{'__PHRASEBOOK'}{'pb'}{'__DEFAULT__'} = Data::Phrasebook->new(@_); |
33
|
2
|
|
|
|
|
16082
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
4
|
|
|
|
|
8
|
foreach my $name (keys %{$_[0]}) { |
|
4
|
|
|
|
|
15
|
|
36
|
8
|
|
|
|
|
12302
|
$self->{'__PHRASEBOOK'}{'pb'}{$name} = Data::Phrasebook->new(%{$_[0]->{$name}}); |
|
8
|
|
|
|
|
65
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub phrasebook { |
41
|
6
|
|
|
6
|
1
|
823
|
my $self = shift; |
42
|
6
|
100
|
|
|
|
40
|
return $self->{'__PHRASEBOOK'}{'pb'}{'__DEFAULT__'} unless @_; |
43
|
2
|
|
|
|
|
13
|
return $self->{'__PHRASEBOOK'}{'pb'}{$_[0]}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |