line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#############################################################################
|
2
|
|
|
|
|
|
|
## Name: NoRef.pm
|
3
|
|
|
|
|
|
|
## Purpose: Hash::NoRef
|
4
|
|
|
|
|
|
|
## Author: Graciliano M. P.
|
5
|
|
|
|
|
|
|
## Modified by:
|
6
|
|
|
|
|
|
|
## Created: 2004-04-16
|
7
|
|
|
|
|
|
|
## RCS-ID:
|
8
|
|
|
|
|
|
|
## Copyright: (c) 2004 Graciliano M. P.
|
9
|
|
|
|
|
|
|
## Licence: This program is free software; you can redistribute it and/or
|
10
|
|
|
|
|
|
|
## modify it under the same terms as Perl itself
|
11
|
|
|
|
|
|
|
#############################################################################
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Hash::NoRef ;
|
14
|
1
|
|
|
1
|
|
33952
|
use 5.006 ;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
264
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
303
|
use strict qw(vars) ;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION @ISA) ;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
74
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$VERSION = '0.03' ;
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
7
|
use DynaLoader ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
23
|
|
|
|
|
|
|
@ISA = qw(DynaLoader) ;
|
24
|
|
|
|
|
|
|
bootstrap Hash::NoRef $VERSION ;
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
7
|
no warnings 'all' ;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
201
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new {
|
29
|
900
|
|
|
900
|
0
|
15238
|
shift ;
|
30
|
900
|
|
|
|
|
1041
|
my %hash ;
|
31
|
900
|
|
|
|
|
3136
|
tie(%hash , 'Hash::NoRef',@_) ;
|
32
|
900
|
|
|
|
|
2066
|
return \%hash ;
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub TIEHASH {
|
36
|
900
|
|
|
900
|
|
1227
|
my $class = shift ;
|
37
|
900
|
|
|
|
|
1962
|
my $this = bless({} , $class) ;
|
38
|
|
|
|
|
|
|
|
39
|
900
|
50
|
|
|
|
1896
|
if (@_) {
|
40
|
0
|
|
|
|
|
0
|
my %content = (@_) ;
|
41
|
0
|
|
|
|
|
0
|
foreach my $Key ( keys %content ) {
|
42
|
0
|
|
|
|
|
0
|
$this->STORE($Key , $content{$Key}) ;
|
43
|
|
|
|
|
|
|
}
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
900
|
|
|
|
|
2156
|
return $this ;
|
47
|
|
|
|
|
|
|
}
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub FETCH {
|
50
|
2000
|
|
|
2000
|
|
69391
|
my $this = shift ;
|
51
|
2000
|
|
|
|
|
2380
|
my $k = shift ;
|
52
|
1
|
|
|
1
|
|
13
|
no warnings ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
53
|
|
|
|
|
|
|
|
54
|
2000
|
100
|
|
|
|
5401
|
if ( !defined $this->{$k} ) { $this->DELETE($k) ;}
|
|
700
|
|
|
|
|
1506
|
|
55
|
|
|
|
|
|
|
|
56
|
2000
|
|
|
|
|
7883
|
return $this->{$k} ;
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub STORE {
|
60
|
1100
|
|
|
1100
|
|
62882
|
my $this = shift ;
|
61
|
1100
|
|
|
|
|
1301
|
my $k = shift ;
|
62
|
1
|
|
|
1
|
|
18
|
no warnings ;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
131
|
|
63
|
|
|
|
|
|
|
|
64
|
1100
|
|
|
|
|
2293
|
$this->{$k} = $_[0] ;
|
65
|
|
|
|
|
|
|
|
66
|
1100
|
100
|
|
|
|
12093
|
if ( ref($_[0]) ) { weaken( $this->{$k} ) ;}
|
|
1000
|
|
|
|
|
2730
|
|
67
|
|
|
|
|
|
|
|
68
|
1100
|
|
|
|
|
2936
|
return $this->{$k} ;
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub EXISTS {
|
72
|
0
|
|
|
0
|
|
0
|
my $this = shift ;
|
73
|
0
|
|
|
|
|
0
|
my $k = shift ;
|
74
|
1
|
|
|
1
|
|
6
|
no warnings ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
102
|
|
75
|
0
|
0
|
|
|
|
0
|
if ( !defined $this->{$k} ) { $this->DELETE($k) ;}
|
|
0
|
|
|
|
|
0
|
|
76
|
0
|
|
|
|
|
0
|
return exists $this->{$k} ;
|
77
|
|
|
|
|
|
|
}
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub DELETE {
|
80
|
1000
|
|
|
1000
|
|
1244
|
my $this = shift ;
|
81
|
1000
|
|
|
|
|
1197
|
my $k = shift ;
|
82
|
1000
|
|
|
|
|
1135
|
my $no_check_alive = shift ;
|
83
|
1
|
|
|
1
|
|
6
|
no warnings ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
84
|
1000
|
|
|
|
|
3034
|
return delete $this->{$k} ;
|
85
|
|
|
|
|
|
|
}
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub CLEAR {
|
88
|
900
|
|
|
900
|
|
1136
|
my $this = shift ;
|
89
|
1
|
|
|
1
|
|
20
|
no warnings ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
151
|
|
90
|
900
|
|
|
|
|
937
|
return %{$this} = () ;
|
|
900
|
|
|
|
|
2189
|
|
91
|
|
|
|
|
|
|
}
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub FIRSTKEY {
|
94
|
0
|
|
|
0
|
|
0
|
my $this = shift ;
|
95
|
0
|
|
|
|
|
0
|
my $tmp = keys %{$this} ;
|
|
0
|
|
|
|
|
0
|
|
96
|
0
|
|
|
|
|
0
|
each %{$this} ;
|
|
0
|
|
|
|
|
0
|
|
97
|
|
|
|
|
|
|
}
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub NEXTKEY {
|
100
|
0
|
|
|
0
|
|
0
|
my $this = shift ;
|
101
|
0
|
|
|
|
|
0
|
each %{$this} ;
|
|
0
|
|
|
|
|
0
|
|
102
|
|
|
|
|
|
|
}
|
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
0
|
|
0
|
sub UNTIE { &DESTROY }
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub DESTROY {
|
107
|
1
|
|
|
1
|
|
6
|
no warnings ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
108
|
900
|
|
|
900
|
|
34974
|
&CLEAR ;
|
109
|
900
|
|
|
|
|
8765
|
return ;
|
110
|
|
|
|
|
|
|
}
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
#######
|
113
|
|
|
|
|
|
|
# END #
|
114
|
|
|
|
|
|
|
#######
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1;
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__
|