in reply to Re^2: How to redefine a modules private function?
in thread How to redefine a modules private function?
Update: sorry, this is rubbish - see Re^5: How to redefine a modules private function?
Can't get AnyEvent installed ATM, but your little demo does work, if you don't "re"define it, but define it before you load the module:Foo.pm as in your example
test2.pluse warnings; use strict; use lib '.'; BEGIN { sub Foo::ONE () { 444 } sub Foo::TWO { 555 } sub Foo::THREE () { 666 } } use Foo; # _after_ your "re"definitions Foo::go; print "One=", Foo::ONE, ", Two=", Foo::TWO, ", Three=", Foo::THREE, "\ +n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How to redefine a modules private function?
by haukex (Archbishop) on Mar 09, 2022 at 13:25 UTC | |
by soonix (Chancellor) on Mar 09, 2022 at 17:08 UTC |