Is there a way to accomplish this without overriding all the base class methods?That depends on how the superclass has implemented the methods.
But you may be able to do something like:
foreach my $method (... list of methods to override ...) { eval <<"EOT"; sub $method { my (\$self, \@args) = \@_; my $result = \$self->SUPER::$method(\@args); bless \$result, __PACKAGE__; \$result; } EOT }
In reply to Re: perl inheritance
by JavaFan
in thread perl inheritance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |