I am trying to extend my company specific BaseClass (Acme::BaseClass) but whenever I:
package Manager;
use strict;
use warnings;
use base qw(Acme::BaseClass)
sub new { ...
it gives me the error:
Base class package "Acme::BaseClass" is empty.
But in my script I can use the package fine:
use Acme::BaseClass;
my $bc = BaseClass->new("myname");
$bc->prnt(); # prints "myname"
exit;
This is my first time trying to inherit in Perl so maybe I am missing something basic?
NOTES:
- I have tried using “parent” and it also does not work
-
I tried to use the old school :
BEGIN {
require Acme::BaseClass;
push @ISA, qw(Acme::BaseClass);
}
I am unsure how to do these correctly either. Hopefully it is something simple I am missing. If nobody can answer it I will add more details.
Judging from your code sample, it sounds like
Acme/BaseClass.pmhas something like this in itand it needs