| 1 | #! perl | ||||||||||
| 2 | |||||||||||
| 3 | package XML::XMetaL::Utilities::Abstract; | ||||||||||
| 4 | |||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | require Exporter; | |||||||||
| 10 | |||||||||||
| 11 | 3 | our @ISA = qw(Exporter); | |||||||||
| 12 | 3 | our @EXPORT = qw(Abstract); | |||||||||
| 13 | |||||||||||
| 14 | 3 | our @parameters = qw(package symbol referent attr data phase); | |||||||||
| 15 | |||||||||||
| 16 | 1 | ▶ | sub abstract { | ||||||||
|
Subroutine
abstract: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 17 | 1 | my ($self) = @_; | |||||||||
| 18 | 1 | my $strCallerClass = ref($self); | |||||||||
| 19 | 1 | my $strAbstractClass = (caller 0)[0]; | |||||||||
| 20 | 1 | my $strMethod = (caller 1)[3]; | |||||||||
| 21 | 1 | $strMethod =~ s/.*::(.*)/$1/; | |||||||||
| 22 | |||||||||||
| 23 | 1 | ▶ | if ($strCallerClass eq $strAbstractClass) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 1 | croak "$strAbstractClass is an abstract base class.". | |||||||||
| 25 | " Attempt to call non-existent method $strMethod"; | ||||||||||
| 26 | } else { | ||||||||||
| 27 | 0 | die "Class $strCallerClass inherited the abstract base class $strAbstractClass ". | |||||||||
| 28 | "but did not redefine the $strMethod method. ". | ||||||||||
| 29 | "Attempt to call non-existent method $strAbstractClass::$strMethod"; | ||||||||||
| 30 | } | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 3 | 1; | |||||||||