line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
11704
|
require 5.005_62; use strict; use warnings;
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01.04';
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
8
|
use Carp;
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
69
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1117
|
use Class::Maker;
|
|
1
|
|
|
|
|
12389
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1006
|
use Class::Listener;
|
|
1
|
|
|
|
|
276
|
|
|
1
|
|
|
|
|
62
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Class::Proxy;
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Class::Maker::class
|
14
|
|
|
|
|
|
|
{
|
15
|
|
|
|
|
|
|
isa => [qw( Class::Listener )],
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
private =>
|
18
|
|
|
|
|
|
|
{
|
19
|
|
|
|
|
|
|
ref => { victim => 'UNIVERSAL' },
|
20
|
|
|
|
|
|
|
},
|
21
|
|
|
|
|
|
|
};
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
7
|
use vars qw($AUTOLOAD);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
317
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _preinit
|
26
|
|
|
|
|
|
|
{
|
27
|
0
|
|
|
0
|
|
|
my $this = shift;
|
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$this->_victim( undef );
|
30
|
|
|
|
|
|
|
}
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _postinit
|
33
|
|
|
|
|
|
|
{
|
34
|
0
|
|
|
0
|
|
|
my $this = shift;
|
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
$this->victim( $this->_victim ) if $this->_victim;
|
37
|
|
|
|
|
|
|
}
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub victim : method
|
40
|
|
|
|
|
|
|
{
|
41
|
0
|
|
|
0
|
1
|
|
my $this = shift;
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $destination = shift;
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Binding to class or object...
|
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
$this->_victim( ref($destination) ? $destination : $destination->new( @_ ) );
|
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$this->signal( 'victim', $this->_victim );
|
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
return $this->_victim;
|
52
|
|
|
|
|
|
|
}
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Future: Class::Proxy should more obscure himself
|
55
|
|
|
|
|
|
|
#
|
56
|
|
|
|
|
|
|
# "goto &func" would be the best solution.
|
57
|
|
|
|
|
|
|
#
|
58
|
|
|
|
|
|
|
# #my $fullfunc = \&{ "${destpack}::$func" };
|
59
|
|
|
|
|
|
|
# #goto &$fullfunc if $victim->can( $func ) or die "unhandled method $victim->$func via Obsessor";
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub AUTOLOAD : method
|
62
|
|
|
|
|
|
|
{
|
63
|
0
|
|
0
|
0
|
|
|
my $this = shift || return undef;
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my @args = @_;
|
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
( my $func = $AUTOLOAD ) =~ s/.*:://;
|
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
return if $func eq 'DESTROY';
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#no strict 'refs';
|
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
@_ = @args;
|
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
$this->Class::Listener::signal( 'method', \$func, \$this->_victim, \@args );
|
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
|
die "unimplemented '$func' called on ".ref( $this->_victim ) unless $this->_victim->can( $func );
|
78
|
|
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
|
return wantarray ? @{ [ $this->_victim->$func( @_ ) ] } : $this->_victim->$func( @_ );
|
|
0
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
}
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1;
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__
|