in reply to Overriding several methods using 'local'

I think you might have an XY problem. I'm pretty sure that there's a better way to do what you're trying to do, but I'd need to have some more context in order to point you in the right direction.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re: Overriding several methods using 'local'

Replies are listed 'Best First'.
Re^2: Overriding several methods using 'local'
by dmitri (Priest) on May 22, 2006 at 16:10 UTC
    The post has been updated. Thanks for the input!
      In response to your update:

      This is where inheritance is quite useful.

      package My::AnyPackage; use base 'AnyPackage'; sub can_read { 1 };

      Now, whenever you would do my $obj = AnyPackage->new( ... );, instead you now do my $obj = My::AnyPackage->new( ... );. And it will "Just Work".


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?