line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#############################################################################
|
2
|
|
|
|
|
|
|
## Name: MultiType.pm
|
3
|
|
|
|
|
|
|
## Purpose: Object::MultiType
|
4
|
|
|
|
|
|
|
## Author: Graciliano M. P.
|
5
|
|
|
|
|
|
|
## Modified by:
|
6
|
|
|
|
|
|
|
## Created: 10/05/2003
|
7
|
|
|
|
|
|
|
## RCS-ID:
|
8
|
|
|
|
|
|
|
## Copyright: (c) 2003 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 Object::MultiType;
|
14
|
1
|
|
|
1
|
|
30060
|
use 5.006 ;
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
44
|
|
15
|
1
|
|
|
1
|
|
6
|
use strict qw(vars) ;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.05';
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
5
|
no warnings ;
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
81
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use overload (
|
21
|
1
|
|
|
|
|
8
|
'bool' => '_OVER_bool' ,
|
22
|
|
|
|
|
|
|
'""' => '_OVER_string' ,
|
23
|
|
|
|
|
|
|
'=' => '_OVER_copy' ,
|
24
|
|
|
|
|
|
|
'+' => '_OVER_inc' ,
|
25
|
|
|
|
|
|
|
'-' => '_OVER_deinc' ,
|
26
|
|
|
|
|
|
|
'0+' => '_OVER_copy' ,
|
27
|
|
|
|
|
|
|
'@{}' => '_OVER_get_array' ,
|
28
|
|
|
|
|
|
|
'%{}' => '_OVER_get_hash' ,
|
29
|
|
|
|
|
|
|
'&{}' => '_OVER_get_code' ,
|
30
|
|
|
|
|
|
|
'*{}' => '_OVER_get_glob' ,
|
31
|
|
|
|
|
|
|
'fallback' => 1 ,
|
32
|
1
|
|
|
1
|
|
1817
|
) ;
|
|
1
|
|
|
|
|
1347
|
|
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
0
|
sub is_saver { 0 ;}
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#######
|
37
|
|
|
|
|
|
|
# NEW #
|
38
|
|
|
|
|
|
|
#######
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new {
|
41
|
17
|
|
|
17
|
1
|
622
|
my $class = shift ;
|
42
|
17
|
|
|
|
|
93
|
my (%args) = @_ ;
|
43
|
|
|
|
|
|
|
|
44
|
17
|
|
|
|
|
74
|
my $saver = Object::MultiType::Saver->new( $args{nodefault} ) ;
|
45
|
17
|
|
|
|
|
35
|
my $this = \$saver ;
|
46
|
17
|
|
|
|
|
35
|
bless($this,$class) ;
|
47
|
|
|
|
|
|
|
|
48
|
17
|
50
|
66
|
|
|
88
|
if (!defined $args{boolsub} && defined $args{boolcode} ) { $args{boolsub} = $args{boolcode} ;}
|
|
0
|
|
|
|
|
0
|
|
49
|
|
|
|
|
|
|
|
50
|
17
|
100
|
|
|
|
51
|
if ( exists $args{bool} ) { $saver->set_bool($args{bool}) ;}
|
|
3
|
100
|
|
|
|
8
|
|
51
|
|
|
|
|
|
|
elsif ( $args{boolsub} ) {
|
52
|
1
|
|
|
|
|
2
|
my $sub = $args{boolsub} ;
|
53
|
1
|
|
|
|
|
3
|
$saver->set_bool(\$sub) ;
|
54
|
|
|
|
|
|
|
}
|
55
|
|
|
|
|
|
|
|
56
|
17
|
50
|
66
|
|
|
76
|
if (!defined $args{scalarsub} && defined $args{scalarcode} ) { $args{scalarsub} = $args{scalarcode} ;}
|
|
0
|
|
|
|
|
0
|
|
57
|
|
|
|
|
|
|
|
58
|
17
|
100
|
|
|
|
45
|
if ( defined $args{scalar} ) { $saver->set_scalar($args{scalar}) ;}
|
|
10
|
100
|
|
|
|
23
|
|
59
|
|
|
|
|
|
|
elsif ( $args{scalarsub} ) {
|
60
|
1
|
|
|
|
|
2
|
my $sub = $args{scalarsub} ;
|
61
|
1
|
|
|
|
|
4
|
$saver->set_scalar(\$sub) ;
|
62
|
|
|
|
|
|
|
}
|
63
|
|
|
|
|
|
|
|
64
|
17
|
100
|
|
|
|
55
|
if ( ref $args{array} eq 'ARRAY' ) { $saver->set_array($args{array}) ;}
|
|
1
|
50
|
|
|
|
3
|
|
65
|
|
|
|
|
|
|
elsif ( $args{tiearray} ) {
|
66
|
0
|
0
|
|
|
|
0
|
if ( $args{tieonuse} ) { $saver->{TIEONUSE}{a} = $args{tiearray} ;}
|
|
0
|
|
|
|
|
0
|
|
67
|
|
|
|
|
|
|
else {
|
68
|
0
|
|
|
|
|
0
|
my @array ; tie(@array,$args{tiearray},$$this) ;
|
|
0
|
|
|
|
|
0
|
|
69
|
0
|
|
|
|
|
0
|
$saver->set_array(\@array) ;
|
70
|
|
|
|
|
|
|
}
|
71
|
|
|
|
|
|
|
}
|
72
|
|
|
|
|
|
|
|
73
|
17
|
100
|
|
|
|
49
|
if ( ref $args{hash} eq 'HASH' ) { $saver->set_hash($args{hash}) ;}
|
|
1
|
50
|
|
|
|
5
|
|
74
|
|
|
|
|
|
|
elsif ( $args{tiehash} ) {
|
75
|
0
|
0
|
|
|
|
0
|
if ( $args{tieonuse} ) { $saver->{TIEONUSE}{h} = $args{tiehash} ;}
|
|
0
|
|
|
|
|
0
|
|
76
|
|
|
|
|
|
|
else {
|
77
|
0
|
|
|
|
|
0
|
my %hash = 1 ; tie(%hash,$args{tiehash},$$this) ;
|
|
0
|
|
|
|
|
0
|
|
78
|
0
|
|
|
|
|
0
|
$saver->set_hash(\%hash) ;
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
}
|
81
|
|
|
|
|
|
|
|
82
|
17
|
100
|
|
|
|
38
|
if ( ref $args{code} eq 'CODE' ) { $saver->set_code( $args{code} ) ;}
|
|
1
|
|
|
|
|
5
|
|
83
|
|
|
|
|
|
|
|
84
|
17
|
50
|
|
|
|
34
|
if ( $args{tiehandle} ) {
|
85
|
0
|
0
|
|
|
|
0
|
if (!$args{glob}) { local(*NULL) ; $args{glob} = \*NULL ;}
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
86
|
|
|
|
|
|
|
|
87
|
0
|
0
|
|
|
|
0
|
if ( $args{tieonuse} ) { $saver->{TIEONUSE}{g} = $args{tiehandle} ;}
|
|
0
|
|
|
|
|
0
|
|
88
|
0
|
|
|
|
|
0
|
else { tie($args{glob} , $args{tiehandle} , $$this) ;}
|
89
|
|
|
|
|
|
|
}
|
90
|
|
|
|
|
|
|
|
91
|
17
|
100
|
|
|
|
37
|
if ( ref $args{glob} eq 'GLOB' ) { $saver->set_glob( $args{glob} ) ;}
|
|
1
|
|
|
|
|
4
|
|
92
|
|
|
|
|
|
|
|
93
|
17
|
|
|
|
|
54
|
return( $this ) ;
|
94
|
|
|
|
|
|
|
}
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
##############
|
97
|
|
|
|
|
|
|
# _OVER_BOOL #
|
98
|
|
|
|
|
|
|
##############
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub _OVER_bool {
|
101
|
7
|
|
|
7
|
|
92
|
my $this = shift ;
|
102
|
|
|
|
|
|
|
|
103
|
7
|
100
|
|
|
|
33
|
if ( !exists $$this->{b} ) {
|
104
|
2
|
|
|
|
|
6
|
return $this->_OVER_string ;
|
105
|
|
|
|
|
|
|
}
|
106
|
|
|
|
|
|
|
|
107
|
5
|
|
|
|
|
14
|
my $bool = $$this->bool ;
|
108
|
|
|
|
|
|
|
|
109
|
5
|
100
|
100
|
|
|
28
|
if (ref($bool) && ref($$bool) eq 'CODE') {
|
110
|
2
|
|
|
|
|
3
|
my $sub = $$bool ;
|
111
|
2
|
|
|
|
|
7
|
return &$sub($this) ;
|
112
|
|
|
|
|
|
|
}
|
113
|
|
|
|
|
|
|
|
114
|
3
|
100
|
|
|
|
9
|
if (ref($bool) eq 'SCALAR') { return( $$bool ) ;}
|
|
1
|
|
|
|
|
5
|
|
115
|
|
|
|
|
|
|
|
116
|
2
|
|
|
|
|
5
|
return( $bool ) ;
|
117
|
|
|
|
|
|
|
}
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
##########
|
120
|
|
|
|
|
|
|
# STRING #
|
121
|
|
|
|
|
|
|
##########
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub _OVER_string {
|
124
|
12
|
|
|
12
|
|
335
|
my $this = shift ;
|
125
|
12
|
|
|
|
|
33
|
my $scalar = $$this->scalar ;
|
126
|
|
|
|
|
|
|
|
127
|
12
|
100
|
|
|
|
29
|
if (ref($$scalar) eq 'CODE') {
|
128
|
1
|
|
|
|
|
2
|
my $sub = $$scalar ;
|
129
|
1
|
|
|
|
|
5
|
return &$sub($this) ;
|
130
|
|
|
|
|
|
|
}
|
131
|
11
|
|
|
|
|
46
|
else { return( $$scalar ) ;}
|
132
|
|
|
|
|
|
|
}
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
#############
|
135
|
|
|
|
|
|
|
# _OVER_INC #
|
136
|
|
|
|
|
|
|
#############
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub _OVER_inc {
|
139
|
2
|
|
|
2
|
|
11
|
my $this = shift ;
|
140
|
2
|
|
|
|
|
7
|
my $scalar = $$this->scalar ;
|
141
|
|
|
|
|
|
|
|
142
|
2
|
|
|
|
|
4
|
my $n ;
|
143
|
2
|
50
|
|
|
|
4
|
if (ref($$scalar) eq 'CODE') {
|
144
|
0
|
|
|
|
|
0
|
my $sub = $$scalar ;
|
145
|
0
|
|
|
|
|
0
|
$n = &$sub($this) ;
|
146
|
|
|
|
|
|
|
}
|
147
|
2
|
|
|
|
|
6
|
else { $n = substr($$scalar , 0 ) ;}
|
148
|
|
|
|
|
|
|
|
149
|
2
|
|
|
|
|
4
|
$n += $_[0] ;
|
150
|
2
|
|
|
|
|
6
|
return $n ;
|
151
|
|
|
|
|
|
|
}
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
###############
|
154
|
|
|
|
|
|
|
# _OVER_DEINC #
|
155
|
|
|
|
|
|
|
###############
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub _OVER_deinc {
|
158
|
2
|
|
|
2
|
|
10
|
my $this = shift ;
|
159
|
2
|
|
|
|
|
6
|
my $scalar = $$this->scalar ;
|
160
|
|
|
|
|
|
|
|
161
|
2
|
|
|
|
|
3
|
my $n ;
|
162
|
2
|
50
|
|
|
|
6
|
if (ref($$scalar) eq 'CODE') {
|
163
|
0
|
|
|
|
|
0
|
my $sub = $$scalar ;
|
164
|
0
|
|
|
|
|
0
|
$n = &$sub($this) ;
|
165
|
|
|
|
|
|
|
}
|
166
|
2
|
|
|
|
|
5
|
else { $n = substr($$scalar , 0 ) ;}
|
167
|
|
|
|
|
|
|
|
168
|
2
|
|
|
|
|
4
|
$n -= $_[0] ;
|
169
|
2
|
|
|
|
|
6
|
return $n ;
|
170
|
|
|
|
|
|
|
}
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
##############
|
173
|
|
|
|
|
|
|
# _OVER_COPY #
|
174
|
|
|
|
|
|
|
##############
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub _OVER_copy {
|
177
|
0
|
|
|
0
|
|
0
|
my $this = shift ;
|
178
|
0
|
|
|
|
|
0
|
my $scalar = $$this->scalar ;
|
179
|
|
|
|
|
|
|
|
180
|
0
|
0
|
|
|
|
0
|
if (ref($$scalar) eq 'CODE') {
|
181
|
0
|
|
|
|
|
0
|
my $sub = $$scalar ;
|
182
|
0
|
|
|
|
|
0
|
return &$sub($this) ;
|
183
|
|
|
|
|
|
|
}
|
184
|
0
|
|
|
|
|
0
|
else { return( substr($$scalar , 0 ) ) ;}
|
185
|
|
|
|
|
|
|
}
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
#############
|
188
|
|
|
|
|
|
|
# GET_ARRAY #
|
189
|
|
|
|
|
|
|
#############
|
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
sub _OVER_get_array {
|
192
|
1
|
|
|
1
|
|
63
|
my $this = shift ;
|
193
|
|
|
|
|
|
|
|
194
|
1
|
50
|
|
|
|
6
|
if ( $$this->{TIEONUSE}{a} ) {
|
195
|
0
|
|
|
|
|
0
|
my @array ; tie(@array, $$this->{TIEONUSE}{a} , $$this) ;
|
|
0
|
|
|
|
|
0
|
|
196
|
0
|
|
|
|
|
0
|
$$this->set_array(\@array) ;
|
197
|
0
|
|
|
|
|
0
|
$$this->{TIEONUSE}{a} = undef ;
|
198
|
|
|
|
|
|
|
}
|
199
|
|
|
|
|
|
|
|
200
|
1
|
|
|
|
|
4
|
return( $$this->array ) ;
|
201
|
|
|
|
|
|
|
}
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
############
|
204
|
|
|
|
|
|
|
# GET_HASH #
|
205
|
|
|
|
|
|
|
############
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub _OVER_get_hash {
|
208
|
1
|
|
|
1
|
|
79
|
my $this = shift ;
|
209
|
|
|
|
|
|
|
|
210
|
1
|
50
|
|
|
|
6
|
if ( $$this->{TIEONUSE}{h} ) {
|
211
|
0
|
|
|
|
|
0
|
my %hash = 1 ; tie(%hash, $$this->{TIEONUSE}{h} ,$$this) ;
|
|
0
|
|
|
|
|
0
|
|
212
|
0
|
|
|
|
|
0
|
$$this->set_hash(\%hash) ;
|
213
|
0
|
|
|
|
|
0
|
$$this->{TIEONUSE}{h} = undef ;
|
214
|
|
|
|
|
|
|
}
|
215
|
|
|
|
|
|
|
|
216
|
1
|
|
|
|
|
5
|
return( $$this->hash ) ;
|
217
|
|
|
|
|
|
|
}
|
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
##################
|
220
|
|
|
|
|
|
|
# _OVER_GET_CODE #
|
221
|
|
|
|
|
|
|
##################
|
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub _OVER_get_code {
|
224
|
1
|
|
|
1
|
|
53
|
my $this = shift ;
|
225
|
|
|
|
|
|
|
|
226
|
1
|
50
|
|
|
|
6
|
if ( !$$this->{SUBCODE} ) {
|
227
|
1
|
|
|
|
|
5
|
$$this->{SUBCODE}{self} = undef ;
|
228
|
|
|
|
|
|
|
|
229
|
1
|
|
|
|
|
5
|
my $sub = $$this->code ;
|
230
|
1
|
|
|
|
|
3
|
my $ref = $$this->{SUBCODE} ;
|
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
$$this->{SUBCODE}{sub} = sub {
|
233
|
1
|
50
|
|
1
|
|
4
|
if (wantarray) {
|
234
|
0
|
|
|
|
|
0
|
my @ret = &$sub( $$ref{self} , @_) ;
|
235
|
0
|
|
|
|
|
0
|
$$ref{self} = undef ;
|
236
|
0
|
|
|
|
|
0
|
return( @ret ) ;
|
237
|
|
|
|
|
|
|
}
|
238
|
|
|
|
|
|
|
else {
|
239
|
1
|
|
|
|
|
5
|
my $ret = &$sub( $$ref{self} , @_) ;
|
240
|
1
|
|
|
|
|
7
|
$$ref{self} = undef ;
|
241
|
1
|
|
|
|
|
3
|
return( $ret ) ;
|
242
|
|
|
|
|
|
|
}
|
243
|
1
|
|
|
|
|
15
|
};
|
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
}
|
246
|
|
|
|
|
|
|
|
247
|
1
|
|
|
|
|
3
|
$$this->{SUBCODE}{self} = $this ;
|
248
|
1
|
|
|
|
|
4
|
return( $$this->{SUBCODE}{sub} ) ;
|
249
|
|
|
|
|
|
|
}
|
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
##################
|
252
|
|
|
|
|
|
|
# _OVER_GET_GLOB #
|
253
|
|
|
|
|
|
|
##################
|
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
sub _OVER_get_glob {
|
256
|
1
|
|
|
1
|
|
6
|
my $this = shift ;
|
257
|
|
|
|
|
|
|
|
258
|
1
|
50
|
|
|
|
5
|
if ( $$this->{TIEONUSE}{g} ) {
|
259
|
0
|
|
|
|
|
0
|
tie($$this->glob , $$this->{TIEONUSE}{g} , $$this) ;
|
260
|
0
|
|
|
|
|
0
|
$$this->{TIEONUSE}{g} = undef ;
|
261
|
|
|
|
|
|
|
}
|
262
|
|
|
|
|
|
|
|
263
|
1
|
|
|
|
|
4
|
return( $$this->glob ) ;
|
264
|
|
|
|
|
|
|
}
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
###########
|
267
|
|
|
|
|
|
|
# DESTROY #
|
268
|
|
|
|
|
|
|
###########
|
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
sub DESTROY {
|
271
|
17
|
|
|
17
|
|
430
|
my $this = shift ;
|
272
|
17
|
|
|
|
|
43
|
$$this->clean ;
|
273
|
|
|
|
|
|
|
}
|
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
############################
|
276
|
|
|
|
|
|
|
# OBJECT::MULTITYPE::SAVER #
|
277
|
|
|
|
|
|
|
############################
|
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
package Object::MultiType::Saver ;
|
280
|
|
|
|
|
|
|
|
281
|
1
|
|
|
1
|
|
1620
|
use strict qw(vars) ;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4719
|
|
282
|
|
|
|
|
|
|
|
283
|
1
|
|
|
1
|
|
11
|
sub is_saver { 1 ;}
|
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
sub new {
|
286
|
17
|
|
|
17
|
|
23
|
my $class = shift ;
|
287
|
17
|
|
|
|
|
34
|
my ( $nodefault ) = @_ ;
|
288
|
|
|
|
|
|
|
|
289
|
17
|
|
|
|
|
18
|
my $this ;
|
290
|
|
|
|
|
|
|
|
291
|
17
|
50
|
|
|
|
28
|
if ($nodefault) { $this = {} ;}
|
|
0
|
|
|
|
|
0
|
|
292
|
|
|
|
|
|
|
else {
|
293
|
17
|
|
|
|
|
34
|
local(*NULL);
|
294
|
|
|
|
|
|
|
$this = {
|
295
|
|
|
|
|
|
|
s => \'' ,
|
296
|
|
|
|
|
|
|
a => [] ,
|
297
|
|
|
|
|
|
|
h => {} ,
|
298
|
0
|
|
|
0
|
|
0
|
c => sub{} ,
|
299
|
17
|
|
|
|
|
142
|
g => \*NULL ,
|
300
|
|
|
|
|
|
|
} ;
|
301
|
|
|
|
|
|
|
}
|
302
|
|
|
|
|
|
|
|
303
|
17
|
|
|
|
|
48
|
bless($this,$class);
|
304
|
17
|
|
|
|
|
34
|
return( $this ) ;
|
305
|
|
|
|
|
|
|
}
|
306
|
|
|
|
|
|
|
|
307
|
5
|
|
|
5
|
|
11
|
sub bool { return( $_[0]->{b} ) ;}
|
308
|
16
|
|
|
16
|
|
34
|
sub scalar { return( $_[0]->{s} ) ;}
|
309
|
1
|
|
|
1
|
|
4
|
sub array { return( $_[0]->{a} ) ;}
|
310
|
1
|
|
|
1
|
|
5
|
sub hash { return( $_[0]->{h} ) ;}
|
311
|
1
|
|
|
1
|
|
17
|
sub code { return( $_[0]->{c} ) ;}
|
312
|
1
|
|
|
1
|
|
7
|
sub glob { return( $_[0]->{g} ) ;}
|
313
|
|
|
|
|
|
|
|
314
|
38
|
|
|
38
|
|
73
|
sub set_bool { $_[0]->{b} = $_[1] ;}
|
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub set_scalar {
|
317
|
45
|
100
|
100
|
45
|
|
122
|
if ($#_ == 0) { $_[0]->{s} = undef ;}
|
|
34
|
100
|
|
|
|
60
|
|
318
|
3
|
|
|
|
|
9
|
elsif (ref($_[1]) ne 'SCALAR' && ref($_[1]) ne 'REF') { $_[0]->{s} = \$_[1] ;}
|
319
|
8
|
|
|
|
|
19
|
else { $_[0]->{s} = $_[1] ;}
|
320
|
|
|
|
|
|
|
}
|
321
|
|
|
|
|
|
|
|
322
|
35
|
|
|
35
|
|
54
|
sub set_array { $_[0]->{a} = $_[1] ;}
|
323
|
35
|
|
|
35
|
|
71
|
sub set_hash { $_[0]->{h} = $_[1] ;}
|
324
|
35
|
|
|
35
|
|
58
|
sub set_code { $_[0]->{c} = $_[1] ;}
|
325
|
35
|
|
|
35
|
|
246
|
sub set_glob { $_[0]->{g} = $_[1] ;}
|
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
sub clean {
|
328
|
34
|
|
|
34
|
|
40
|
my $this = shift ;
|
329
|
34
|
|
|
|
|
57
|
$this->set_bool() ;
|
330
|
34
|
|
|
|
|
58
|
$this->set_scalar() ;
|
331
|
34
|
|
|
|
|
65
|
$this->set_array() ;
|
332
|
34
|
|
|
|
|
65
|
$this->set_hash() ;
|
333
|
34
|
|
|
|
|
56
|
$this->set_code() ;
|
334
|
34
|
|
|
|
|
71
|
$this->set_glob() ;
|
335
|
|
|
|
|
|
|
}
|
336
|
|
|
|
|
|
|
|
337
|
17
|
|
|
17
|
|
29
|
sub DESTROY { &clean ;}
|
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
#######
|
340
|
|
|
|
|
|
|
# END #
|
341
|
|
|
|
|
|
|
#######
|
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
1;
|
344
|
|
|
|
|
|
|
__END__
|