line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package asa; # git description: ad0fc97 |
2
|
|
|
|
|
|
|
# ABSTRACT: Lets your class/object say it works like something else |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
70852
|
use 5.005; |
|
1
|
|
|
|
|
13
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
6
|
use Carp (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
170
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.04'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
2
|
|
|
2
|
|
345
|
my $class = shift; |
12
|
2
|
|
|
|
|
5
|
my $have = caller(0); |
13
|
|
|
|
|
|
|
my $code = join '', |
14
|
|
|
|
|
|
|
"package $have;\n", |
15
|
|
|
|
|
|
|
"\n", |
16
|
|
|
|
|
|
|
"sub isa {\n", |
17
|
2
|
|
|
|
|
43
|
( map { "\treturn 1 if \$_[1] eq '$_';\n" } @_ ), |
|
3
|
|
|
|
|
12
|
|
18
|
|
|
|
|
|
|
"\tshift->SUPER::isa(\@_);\n", |
19
|
|
|
|
|
|
|
"}\n"; |
20
|
2
|
100
|
|
3
|
|
172
|
eval( $code ); |
|
3
|
100
|
|
4
|
|
2926
|
|
|
2
|
100
|
|
|
|
15
|
|
|
4
|
|
|
|
|
3203
|
|
|
3
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
14
|
|
21
|
2
|
50
|
|
|
|
10
|
Carp::croak( "Failed to create isa method: $@" ) if $@; |
22
|
2
|
|
|
|
|
1388
|
return 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |