I'm not sure exactly how I should do that. Would you have the constructor take a base class object and convert it to the derived? Something like the following:
Would invoking this form of the derived class constructor through AUTOLOAD be considered bad practice? This is so that all base class methods do not have to be overridden?sub new { if (ref $class eq 'base') { //return derived object built from base class object } //return derived object built from parameters }
In reply to Re^2: perl inheritance
by Anonymous Monk
in thread perl inheritance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |