line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::Maketext::Lexicon::Tie; |
2
|
|
|
|
|
|
|
$Locale::Maketext::Lexicon::Tie::VERSION = '1.00'; |
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
11
|
use Symbol (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Use tied hashes as lexicons for Maketext |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub parse { |
10
|
2
|
|
|
2
|
0
|
31
|
my $self = shift; |
11
|
2
|
|
|
|
|
28
|
my $mod = shift; |
12
|
2
|
|
|
|
|
41
|
my $sym = Symbol::gensym(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Load the target module into memory |
15
|
|
|
|
|
|
|
{ |
16
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
198
|
|
|
2
|
|
|
|
|
81
|
|
17
|
2
|
50
|
0
|
|
|
24
|
eval "use $mod; 1" or die $@ unless %{"$mod\::"}; |
|
2
|
|
|
|
|
54
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# Perform the actual tie |
21
|
2
|
|
|
|
|
17
|
tie %{*$sym}, $mod, @_; |
|
2
|
|
|
|
|
56
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Returns the GLOB reference, so %Lexicon will be tied too |
24
|
2
|
|
|
|
|
26
|
return $sym; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |