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