in reply to Dynamic Subroutines

You can define an AUTOLOAD sub.

It is called in place of any undefined sub and receive in the $AUTOLOAD variable the name of the sub originally invoked. You can test $AUTOLOAD to see if it matches your naming conventions (in your example /sub\d+/).

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

Replies are listed 'Best First'.
Re^2: Dynamic Subroutines
by Anonymous Monk on Jul 13, 2009 at 18:32 UTC
    The issue is that the subroutine is actually defined in the parent class..I need to define that in the child class just to say "This is not accessible!" .
    Because I am inheriting it from the Parent.. So I cant use AUTOLOAD...

      What kind of class is it, you are trying to Lindskovs principle on? Could you shed some more light on why you want to do this and why it isn't viable to refactor the parent class?