| 1 | package Net::ACME::AccessorBase; | ||||||||||
| 2 | |||||||||||
| 3 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 10 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 10 | our $AUTOLOAD; | |||||||||
| 7 | |||||||||||
| 8 | #sub _ACCESSORS { ... } | ||||||||||
| 9 | |||||||||||
| 10 | 12 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 11 | 12 | my ($class, %opts) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 12 | $opts{"_$_"} = delete $opts{$_} for keys %opts; | |||||||||
| 14 | |||||||||||
| 15 | 12 | return bless \%opts, $class; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 65 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=14.2
| |||||||||||
| 19 | 65 | my ($self) = @_; | |||||||||
| 20 | |||||||||||
| 21 | 65 | ▶ | $AUTOLOAD =~ m<(.+)::(.+)> or die "Weird func name: “$AUTOLOAD”!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 65 | my ($class, $method) = ($1, $2); | |||||||||
| 23 | |||||||||||
| 24 | 65 | ▶ | if ( grep { $method eq $_ } $self->_ACCESSORS() ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 53 | return $self->{"_$method"}; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 12 | ▶ | return if $method eq 'DESTROY'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | die "“$class” doesn’t define a method “$method”!"; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 10 | 1; | |||||||||