output:my $foo = Foo->new; *Foo::bar = sub { print "bar\n"; }; $foo->bar(); undef *Foo::bar; $foo->bar(); package Foo; sub new { return bless {}, shift; } 1;
bar Can't locate object method "bar" via package "Foo" at foo.pl line 9.
In reply to Re: adding temporary method to a class
by duckyd
in thread adding temporary method to a class
by jeteve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |