You might want to add a pair of braces and a no warnings 'redefine'; to that.
my $old = \&method; { no warnings 'redefine'; *method = sub { # Do something new my @return = $old->( @args ); # Do something else }; }
In reply to Re^2: How to redefine a method and still reference the original.
by BrowserUk
in thread How to redefine a method and still reference the original.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |