line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::PObject::Type::MD5; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# MD5.pm,v 1.3 2003/09/09 00:11:59 sherzodr Exp |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
55
|
|
|
3
|
|
|
|
|
115
|
|
6
|
|
|
|
|
|
|
#use diagnostics; |
7
|
3
|
|
|
3
|
|
16
|
use vars ('$VERSION', '@ISA'); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
157
|
|
8
|
3
|
|
|
3
|
|
18
|
use Digest::MD5 ("md5_hex"); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
159
|
|
9
|
3
|
|
|
3
|
|
16
|
use Class::PObject::Type; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
225
|
|
10
|
|
|
|
|
|
|
use overload ( |
11
|
3
|
|
|
3
|
|
14
|
'eq' => sub { $_[0]->id eq md5_hex($_[1]) }, |
12
|
0
|
0
|
|
0
|
|
0
|
bool => sub { $_[0]->id ? 1 : 0 }, |
13
|
3
|
|
|
|
|
43
|
fallback => 1, |
14
|
3
|
|
|
3
|
|
16
|
); |
|
3
|
|
|
|
|
10
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = '1.00'; |
17
|
|
|
|
|
|
|
@ISA = ("Class::PObject::Type"); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _init { |
20
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
21
|
1
|
50
|
|
|
|
8
|
$self->id or return undef; |
22
|
1
|
|
|
|
|
5
|
$self->{id} = md5_hex($self->id) |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
__END__ |