| 1 | package CURRENT; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use vars qw( $VERSION ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | $VERSION = '0.01'; | |||||||||
| 8 | |||||||||||
| 9 | 0 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: not called CC=3 SCAR=21.3
| |||||||||||
| 10 | 0 | my ($self) = @_; | |||||||||
| 11 | |||||||||||
| 12 | 0 | my $caller_class = caller; | |||||||||
| 13 | 0 | my ($wanted_method) = $CURRENT::AUTOLOAD =~ m{.*::(.*)}g; | |||||||||
| 14 | |||||||||||
| 15 | 0 | my $object_method = $caller_class->can($wanted_method); | |||||||||
| 16 | 0 | ▶ | goto $object_method if $object_method; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | if ( my $autoload = $caller_class->can('AUTOLOAD') ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | require B; | |||||||||
| 20 | 0 | my $autoload_class = B::svref_2object($autoload)->GV->STASH->NAME; | |||||||||
| 21 | |||||||||||
| 22 | 1 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 0 | ${"${autoload_class}::AUTOLOAD"} = "${caller_class}::$wanted_method"; | |||||||||
| 24 | |||||||||||
| 25 | 0 | goto $autoload; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | croak( | ||||||||||
| 29 | 0 | qq{Can't locate object method "$wanted_method"}, | |||||||||
| 30 | qq{ via package "$caller_class"}, | ||||||||||
| 31 | ); | ||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | 1; | |||||||||
| 35 | __END__ | ||||||||||