line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TM::Tied::Map; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
850
|
use Tie::Hash; |
|
1
|
|
|
|
|
882
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
6
|
use base qw(Tie::StdHash); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1173
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub STORE { |
9
|
0
|
|
|
0
|
|
|
my ($self, $key, $value) = @_; |
10
|
0
|
|
|
|
|
|
warn "STORE $key"; |
11
|
0
|
|
|
|
|
|
return $self->{lc $key} = $value; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
sub FETCH { |
14
|
0
|
|
|
0
|
|
|
my ($self, $key) = @_; |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
if ($key =~ /^__/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return $self->{$key}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} elsif ($key =~ /(.*?)\s*=\s*$/) { # subject address |
20
|
0
|
|
|
|
|
|
my $url = $1; # why do I need this? |
21
|
0
|
|
0
|
|
|
|
my $tid = $self->{__tm}->tids ($url) || die "topic with subject address '$1' does not exist"; |
22
|
0
|
|
|
|
|
|
return new TM::Easy::Topic ($tid, $self->{__tm}); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} elsif ($key =~ /(.*?)\s*~\s*$/) { # subject identifier |
25
|
0
|
|
|
|
|
|
my $url = $1; # why do I need this? |
26
|
0
|
|
0
|
|
|
|
my $tid = $self->{__tm}->tids (\ $url) || die "topic with subject identifier '$1' does not exist"; |
27
|
0
|
|
|
|
|
|
return new TM::Easy::Topic ($tid, $self->{__tm}); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} elsif ($key =~ /((http|ftp|mailto):.*)/) { # subject identifier |
30
|
0
|
|
|
|
|
|
my $url = $1; # why do I need this? |
31
|
0
|
|
0
|
|
|
|
my $tid = $self->{__tm}->tids (\ $url) || die "topic with subject identifier '$1' does not exist"; |
32
|
0
|
|
|
|
|
|
return new TM::Easy::Topic ($tid, $self->{__tm}); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} else { # id |
35
|
0
|
|
0
|
|
|
|
my $tid = $self->{__tm}->tids ($key) || die "topic with local identifier '$key' does not exist"; |
36
|
0
|
|
|
|
|
|
return new TM::Easy::Topic ($tid, $self->{__tm}); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
sub EXISTS { |
40
|
0
|
|
|
0
|
|
|
my ($self, $key) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
if ($key =~ /^__/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return exists $self->{$key}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} elsif ($key =~ /(.*?)\s*=\s*$/) { # subject address |
46
|
0
|
|
|
|
|
|
my $url = $1; # why do I need this? |
47
|
0
|
|
|
|
|
|
return $self->{__tm}->tids ($url); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} elsif ($key =~ /(.*?)\s*~\s*$/) { # subject identifier |
50
|
0
|
|
|
|
|
|
my $url = $1; |
51
|
0
|
|
|
|
|
|
return $self->{__tm}->tids (\ $url); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} elsif ($key =~ /((http|ftp|mailto):.*)/) { # subject identifier |
54
|
0
|
|
|
|
|
|
my $url = $1; |
55
|
0
|
|
|
|
|
|
return $self->{__tm}->tids (\ $url); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} else { # id |
58
|
0
|
|
|
|
|
|
return $self->{__tm}->tids ($key); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
sub DEFINED { |
62
|
0
|
|
|
0
|
0
|
|
my ($self, $key) = @_; |
63
|
0
|
|
|
|
|
|
return defined $self->{lc $key}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
sub TIEHASH { |
66
|
0
|
|
|
0
|
|
|
my $self = bless {}, shift; |
67
|
0
|
|
|
|
|
|
$self->{__tm} = shift; |
68
|
0
|
|
|
|
|
|
return $self; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
sub FIRSTKEY { |
71
|
0
|
|
|
0
|
|
|
my $self = shift; |
72
|
0
|
|
|
|
|
|
return each %{$self->{__tm}->{mid2iid}}; |
|
0
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
sub NEXTKEY { |
75
|
0
|
|
|
0
|
|
|
my $self = shift; |
76
|
0
|
|
|
|
|
|
my $thiskey = shift; |
77
|
0
|
|
|
|
|
|
return each %{$self->{__tm}->{mid2iid}}; |
|
0
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |