Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: super(params)by frag (Hermit) |
on Jan 15, 2002 at 23:19 UTC ( [id://139003]=note: print w/replies, xml ) | Need Help?? |
There's at least a potential hazard in this approach: what if your parent constructor does parameter checking, and is more restrictive than your subclass? Then the above would be dangerous -- you'd lose the values in %params -- and you'd want to do something like:
Ugly and hypothetical, but something to be aware of. On second thought, better still: always make any parameter checking in the constructors throw a fatal error. Note such errors in development and change the parent's constructor to play nice. -- Frag.
In Section
Seekers of Perl Wisdom
|
|