in reply to Re: Overriding several methods using 'local'
in thread Overriding several methods using 'local'

The post has been updated. Thanks for the input!
  • Comment on Re^2: Overriding several methods using 'local'

Replies are listed 'Best First'.
Re^3: Overriding several methods using 'local'
by dragonchild (Archbishop) on May 22, 2006 at 17:05 UTC
    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?