RE: Attempting OO with Perl - New() method in subclass not working

2005-04-01 Thread Brad.Carlson
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 {

RE: Attempting OO with Perl - New() method in subclass not working

2005-04-01 Thread Brad.Carlson
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 = {};

Module and file naming conventions

2005-04-01 Thread Brad.Carlson
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

Attempting OO with Perl - New() method in subclass not working

2005-03-31 Thread Brad.Carlson
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