line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Alias::Hash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26313
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
46
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
44
|
|
6
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
482
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
0
|
0
|
|
sub isAlias { 1; }; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIEHASH { |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
|
|
my ( $class , $ref ) = @_ ; |
15
|
0
|
0
|
|
|
|
|
ref($ref) or croak "NOT A REFERENCE"; |
16
|
0
|
0
|
|
|
|
|
if ( eval { tied($$ref) -> isAlias } ) { |
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# we are re-aliasing something |
18
|
0
|
|
|
|
|
|
return tied ($$ref); |
19
|
|
|
|
|
|
|
}else{ |
20
|
|
|
|
|
|
|
# $ref is already a pointer to the object |
21
|
0
|
|
|
|
|
|
bless $ref, $class; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub FETCH{ |
26
|
0
|
|
|
0
|
|
|
$_[0]->{$_[1]}; |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
sub STORE{ |
29
|
0
|
|
|
0
|
|
|
$_[0]->{$_[1]} = $_[2]; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
sub EXISTS{ |
32
|
0
|
|
|
0
|
|
|
exists $_[0]->{$_[1]}; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
sub DELETE{ |
35
|
0
|
|
|
0
|
|
|
delete $_[0]->{$_[1]}; |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
sub CLEAR{ |
38
|
0
|
|
|
0
|
|
|
%{$_[0]} = (); |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
sub FIRSTKEY{ |
41
|
0
|
|
|
0
|
|
|
keys %{$_[0]}; |
|
0
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
each %{$_[0]}; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
sub NEXTKEY{ |
45
|
0
|
|
|
0
|
|
|
each %{$_[0]}; |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |