in reply to Re^4: Overriding 'static' methods of a perl package
in thread Overriding 'static' methods of a perl package

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;

Replies are listed 'Best First'.
Re^6: Overriding 'static' methods of a perl package
by Anonymous Monk on Sep 16, 2008 at 16:07 UTC
    DOH! (mental head slap)

    I didn't even think of that. I was so fixated on making 'inheritance' work the way I wanted to, I missed the big picture.

    The 'compliation error' was the fact that parent.pm was not installed on the system. Do you consider 5.8.5 'old'?

    Thanks for all your help and the excellent suggestion.

      Do you consider 5.8.5 'old'?

      For something released four years ago that's probably an acceptable declaration.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        And 'current' would be???