Assuming you have a base class called Money and a subclass called Coin
(where the Coin package declares @ISA = qw (Money)), what is the
appropriate naming convention?
Classes - Money and Money::Coin
Files - Money.pm and Money/Coin.pm
or
Classes - Money and Coin
Files - Money.pm and Coin.pm
Okay, why is the subclass's new() not required? Is it because the
DBLogon's additional field (DBNAME) is added via the _init() method? So
you end up with something like this:
# Base class Logon new()
sub new {
my $that = shift;
my $class = ref($that) || $that;
my $self = {};
bles
Thank you!
I tried the SUPER->_init() and that took care of it. However, I donn't
want to force an inherited class to have to know how the parent's new()
works, so I tried this as well (and it worked) - I have the new() call
it's own _init explicitly:
# the new() from Logon.pm
sub new {
I am trying to build an inheritable object, and I am using examples from
the Perl Cookbook, 2nd edition, mostly Recipe 13.1, using the new and
_init methods.
I created a base class Logon and a subclass called DBLogon, in files
Logon.pm and DBLogon.pm, respectively. All referenced files are copi