line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Class::Printable; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
23886
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
## overload operator |
10
|
1
|
|
|
1
|
|
2027
|
use overload q|""| => "toString", fallback => 1; |
|
1
|
|
|
|
|
1724
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
### methods |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# this is the method to be overloaded |
15
|
|
|
|
|
|
|
sub toString { |
16
|
5
|
|
|
5
|
1
|
5112
|
my ($self) = @_; |
17
|
5
|
|
|
|
|
14
|
return $self->stringValue(); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# return the unmolested object string |
22
|
|
|
|
|
|
|
sub stringValue { |
23
|
8
|
|
|
8
|
1
|
4910
|
my ($self) = @_; |
24
|
8
|
|
|
|
|
21
|
return overload::StrVal($self); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |