in reply to The correct way to redefine a routine
It is better to use sub-classing if you can:
and then use My::Foo::Bar instead of Foo::Bar. Now the original do_magic is preserved for those other modules which need it.package My::Foo::Bar; @ISA = qw(Foo::Bar); sub do_magic { ... } # tinker here
Update: use base ... is better than setting @ISA, but they accomplish the same thing.
|
|---|