line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Builtin::Scalar; |
2
|
5
|
|
|
5
|
|
121
|
use 5.008001; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
254
|
|
3
|
5
|
|
|
5
|
|
32
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
148
|
|
4
|
5
|
|
|
5
|
|
28
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
380
|
|
5
|
|
|
|
|
|
|
our $VERSION = sprintf "%d.%02d", q$Revision: 0.3 $ =~ /(\d+)/g; |
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
29
|
use Carp; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
467
|
|
8
|
5
|
|
|
5
|
|
7440
|
use Encode (); |
|
5
|
|
|
|
|
138312
|
|
|
5
|
|
|
|
|
2355
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use overload ( |
11
|
1
|
|
|
1
|
|
7
|
bool => sub { !! ${ $_[0] } }, |
|
1
|
|
|
|
|
9
|
|
12
|
4
|
|
|
4
|
|
30
|
'""' => sub { ${ $_[0] } . '' }, |
|
4
|
|
|
|
|
33
|
|
13
|
3
|
|
|
3
|
|
3
|
'0+' => sub { ${ $_[0] } + 0 }, |
|
3
|
|
|
|
|
11
|
|
14
|
1
|
|
|
1
|
|
10
|
'@{}' => sub { $_[0]->split(qr//) }, |
15
|
|
|
|
|
|
|
# unary ops |
16
|
5
|
50
|
|
3
|
|
525
|
(map { $_ => eval qq{sub { |
|
65
|
100
|
|
|
|
11103
|
|
|
3
|
50
|
|
|
|
994
|
|
|
3
|
100
|
|
|
|
12
|
|
|
3
|
50
|
|
|
|
11
|
|
|
1
|
100
|
|
|
|
3
|
|
|
3
|
50
|
|
|
|
18
|
|
|
2
|
100
|
|
|
|
1490
|
|
|
2
|
50
|
|
|
|
8
|
|
|
2
|
100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|
|
|
22
|
|
|
2
|
|
|
|
|
1513
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
1108
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
22
|
|
17
|
|
|
|
|
|
|
__PACKAGE__->new($_ \${\$_[0]}); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} } qw{ ~ }), |
20
|
|
|
|
|
|
|
# binary numeric ops |
21
|
10
|
50
|
|
5
|
|
2321
|
(map { $_ => eval qq{sub { |
|
5
|
100
|
|
|
|
2660
|
|
|
5
|
50
|
|
|
|
16
|
|
|
5
|
100
|
|
|
|
15
|
|
|
1
|
|
|
|
|
3
|
|
|
5
|
|
|
|
|
50
|
|
|
40
|
|
|
|
|
38073
|
|
|
40
|
|
|
|
|
358
|
|
|
40
|
|
|
|
|
134
|
|
|
1
|
|
|
|
|
3
|
|
|
40
|
|
|
|
|
789
|
|
22
|
|
|
|
|
|
|
my \$l = ref \$_[0] ? \${\$_[0]} : \$_[0]; |
23
|
|
|
|
|
|
|
my \$r = ref \$_[1] ? \${\$_[1]} : \$_[1]; |
24
|
|
|
|
|
|
|
# warn "\$l $_ \$r"; |
25
|
|
|
|
|
|
|
__PACKAGE__->new(\$l $_ \$r); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} } qw{+ - * / % ** << >> & | ^ . x }), |
28
|
|
|
|
|
|
|
# comparison ops -- bools are not objects |
29
|
5
|
|
|
|
|
306
|
(map { $_ => eval qq{sub { |
30
|
|
|
|
|
|
|
my \$l = ref \$_[0] ? \${\$_[0]} : \$_[0]; |
31
|
|
|
|
|
|
|
my \$r = ref \$_[1] ? \${\$_[1]} : \$_[1]; |
32
|
|
|
|
|
|
|
\$l $_ \$r; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} } qw{ <=> cmp }), |
35
|
|
|
|
|
|
|
fallback => 1, |
36
|
5
|
|
|
5
|
|
10149
|
); |
|
5
|
|
|
|
|
12327
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new { |
39
|
104
|
|
|
104
|
0
|
235
|
my ( $class, $scalar ) = @_; |
40
|
104
|
50
|
|
|
|
317
|
return $scalar if ref $scalar; |
41
|
104
|
|
|
|
|
2482
|
bless \$scalar, $class; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub clone{ |
45
|
0
|
|
|
0
|
0
|
0
|
__PACKAGE__->new( ${$_[0]} ); |
|
0
|
|
|
|
|
0
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
84
|
|
|
84
|
0
|
164
|
sub unbless{ ${$_[0]} } |
|
84
|
|
|
|
|
288
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub dump { |
51
|
0
|
|
|
0
|
0
|
0
|
local ($Data::Dumper::Terse) = 1; |
52
|
0
|
|
|
|
|
0
|
local ($Data::Dumper::Indent) = 0; |
53
|
0
|
|
|
|
|
0
|
local ($Data::Dumper::Useqq) = 1; |
54
|
0
|
|
|
|
|
0
|
sprintf 'OO(%s)', Data::Dumper::Dumper(${$_[0]}); |
|
0
|
|
|
|
|
0
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my @unary = qw( |
58
|
|
|
|
|
|
|
length defined ref |
59
|
|
|
|
|
|
|
chomp chop chr lc lcfirst ord reverse uc ucfirst |
60
|
|
|
|
|
|
|
cos sin exp log sqrt int |
61
|
|
|
|
|
|
|
hex oct |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
for my $meth (@unary) { |
65
|
0
|
|
|
0
|
0
|
0
|
eval qq{ |
|
0
|
|
|
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
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
56
|
|
|
1
|
|
|
|
|
53
|
|
|
1
|
|
|
|
|
11
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
66
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
my \$self = shift; |
69
|
|
|
|
|
|
|
my \$ret = CORE::$meth(\$\$self); |
70
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
}; |
73
|
|
|
|
|
|
|
croak $@ if $@; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub atan2{ |
77
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
78
|
0
|
|
0
|
|
|
0
|
my $second = shift || 1; |
79
|
0
|
|
|
|
|
0
|
__PACKAGE__->new( CORE::atan2($$self, $second) ); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# prototype: $$ => $ |
83
|
|
|
|
|
|
|
for my $meth (qw/crypt/) { |
84
|
0
|
|
|
0
|
0
|
0
|
eval qq{ |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
85
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
my \$self = shift; |
88
|
|
|
|
|
|
|
my \$arg0 = shift; |
89
|
|
|
|
|
|
|
my \$ret = CORE::$meth(\$\$self, \$arg0); |
90
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
croak $@ if $@; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
# prototype: $$ => @ |
96
|
|
|
|
|
|
|
sub unpack{ |
97
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
98
|
0
|
|
|
|
|
0
|
my $form = shift; |
99
|
0
|
|
|
|
|
0
|
my @ret = CORE::unpack $$self, $form; |
100
|
0
|
|
|
|
|
0
|
__PACKAGE__->new([\@ret]); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
# prototype: $$;$ |
104
|
|
|
|
|
|
|
for my $meth (qw/index rindex/) { |
105
|
0
|
0
|
|
0
|
0
|
0
|
eval qq{ |
|
0
|
0
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
106
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
107
|
|
|
|
|
|
|
{ |
108
|
|
|
|
|
|
|
my \$self = shift; |
109
|
|
|
|
|
|
|
my \$arg0 = shift; |
110
|
|
|
|
|
|
|
my \$ret = \@_ ? CORE::$meth(\$\$self, \$arg0, shift) |
111
|
|
|
|
|
|
|
: CORE::$meth(\$\$self, \$arg0); |
112
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
}; |
115
|
|
|
|
|
|
|
croak $@ if $@; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# prototype:$@ |
119
|
|
|
|
|
|
|
for my $meth (qw/pack sprintf/) { |
120
|
0
|
|
|
0
|
0
|
0
|
eval qq{ |
|
0
|
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
121
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
122
|
|
|
|
|
|
|
{ |
123
|
|
|
|
|
|
|
my \$self = shift; |
124
|
|
|
|
|
|
|
my \$ret = CORE::$meth(\$\$self, \@_); |
125
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
}; |
128
|
|
|
|
|
|
|
croak $@ if $@; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub substr { |
132
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
133
|
0
|
0
|
|
|
|
0
|
croak unless @_ > 0; |
134
|
0
|
0
|
|
|
|
0
|
my $ret = |
|
|
0
|
|
|
|
|
|
135
|
|
|
|
|
|
|
@_ == 1 ? CORE::substr $$self, $_[0] |
136
|
|
|
|
|
|
|
: @_ == 2 ? CORE::substr $$self, $_[0], $_[1] |
137
|
|
|
|
|
|
|
: CORE::substr @$self, $_[0], $_[1], $_[2]; |
138
|
0
|
0
|
|
|
|
0
|
return @_ > 2 ? $self : __PACKAGE__->new($ret); |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub split { |
142
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
143
|
1
|
|
33
|
|
|
11
|
my $pat = shift || qr//; |
144
|
1
|
|
|
|
|
8
|
my @ret = CORE::split $pat, $$self; |
145
|
1
|
|
|
|
|
12
|
Class::Builtin::Array->new( [@ret] ); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub print { |
149
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
150
|
0
|
0
|
|
|
|
0
|
@_ ? CORE::print {$_[0]} $$self : CORE::print $$self; |
|
0
|
|
|
|
|
0
|
|
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub say { |
154
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
155
|
0
|
|
|
|
|
0
|
local $\ = "\n"; |
156
|
0
|
0
|
|
|
|
0
|
@_ ? CORE::print {$_[0]} $$self : CORE::print $$self; |
|
0
|
|
|
|
|
0
|
|
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub methods { |
160
|
0
|
|
|
|
|
0
|
Class::Builtin::Array->new( |
161
|
0
|
|
|
0
|
1
|
0
|
[ sort grep { defined &{$_} } keys %Class::Builtin::Scalar:: ] ); |
|
0
|
|
|
|
|
0
|
|
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
# Encode-related |
165
|
|
|
|
|
|
|
for my $meth (qw/decode encode decode_utf8/){ |
166
|
0
|
|
|
0
|
0
|
0
|
eval qq{ |
|
0
|
|
|
3
|
0
|
0
|
|
|
0
|
|
|
0
|
0
|
0
|
|
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
24
|
|
|
3
|
|
|
|
|
361
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
168
|
|
|
|
|
|
|
{ |
169
|
|
|
|
|
|
|
my \$self = shift; |
170
|
|
|
|
|
|
|
my \$ret = Encode::$meth(\$\$self,\@_); |
171
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
croak $@ if $@; |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
for my $meth (qw/encode_utf8/){ |
177
|
0
|
|
|
0
|
0
|
|
eval qq{ |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
179
|
|
|
|
|
|
|
{ |
180
|
|
|
|
|
|
|
my \$self = shift; |
181
|
|
|
|
|
|
|
my \$ret = Encode::$meth(\$\$self); |
182
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
}; |
185
|
|
|
|
|
|
|
croak $@ if $@; |
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
*bytes = \&encode_utf8; |
189
|
|
|
|
|
|
|
*utf8 = \&decode_utf8; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
# Scalar::Util |
192
|
|
|
|
|
|
|
# dualvar() and set_prototype() not included |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
our @scalar_util = qw( |
195
|
|
|
|
|
|
|
blessed isweak readonly refaddr reftype tainted |
196
|
|
|
|
|
|
|
weaken isvstring looks_like_number |
197
|
|
|
|
|
|
|
); |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
for my $meth (qw/blessed isweak refaddr reftype weaken/){ |
200
|
0
|
|
|
0
|
0
|
|
eval qq{ |
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
202
|
|
|
|
|
|
|
{ |
203
|
|
|
|
|
|
|
my \$self = shift; |
204
|
|
|
|
|
|
|
my \$ret = Scalar::Util::$meth(\$self); |
205
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
}; |
208
|
|
|
|
|
|
|
croak $@ if $@; |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
for my $meth (qw/readonly tainted isvstring looks_like_number/){ |
212
|
0
|
|
|
0
|
0
|
|
eval qq{ |
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub Class::Builtin::Scalar::$meth |
214
|
|
|
|
|
|
|
{ |
215
|
|
|
|
|
|
|
my \$self = shift; |
216
|
|
|
|
|
|
|
my \$ret = Scalar::Util::$meth(\$\$self); |
217
|
|
|
|
|
|
|
__PACKAGE__->new(\$ret); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
}; |
220
|
|
|
|
|
|
|
croak $@ if $@; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
1; # End of Class::Builtin::Scalar |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head1 NAME |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Class::Builtin::Scalar - Scalar as an object |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=head1 VERSION |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
$Id: Scalar.pm,v 0.3 2009/06/22 15:52:18 dankogai Exp $ |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=head1 SYNOPSIS |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
use Class::Builtin::Scalar; # use Class::Builtin::Builtin; |
236
|
|
|
|
|
|
|
my $foo = Class::Builtin::Scalar->new('perl'); # OO('perl'); |
237
|
|
|
|
|
|
|
print $foo->length; # 4 |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=head1 EXPORT |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
None. But see L |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head1 METHODS |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
This section is under construction. For the time being, try |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
print Class::Builtin::Scalar->new(0)->methods->join("\n") |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=head1 TODO |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
This section itself is to do :) |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=over 2 |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=item * what should C<< $s->m(qr/.../) >> return ? SCALAR ? ARRAY ? |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=item * more methods |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=back |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=head1 SEE ALSO |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
L, L, L |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=head1 AUTHOR |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
Dan Kogai, C<< >> |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
L, L, L L |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
Copyright 2009 Dan Kogai, all rights reserved. |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
278
|
|
|
|
|
|
|
under the same terms as Perl itself. |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=cut |