As you keep the exact text of "compilation error" to yourself, I won't be able to help you with that. The most likely reason is that parent.pm is not installed on your machine. You could try the substitute base.pm that is distributed with older versions of Perl.
I can only iterate it again. If you want to use features such as "inheritance", you'll have to use the object syntax everywhere.
Of course, for customizing the behaviour of the One Big Subroutine, it's likely easier to pass it a callback and in its absence to use a default routine:
package Parent; sub name { return 'Parent' }; sub identify { my (%options) = @_; $options{ get_name } ||= \&name; print "Hello " . $options{ get_name }->() . "\n"; }; package Child; sub identify { Parent::identify( get_name => sub { 'Child' }); }; 1;
In reply to Re^5: Overriding 'static' methods of a perl package
by Corion
in thread Overriding 'static' methods of a perl package
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |