in reply to Re: How to redefine a method and still reference the original.
in thread How to redefine a method and still reference the original.
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 }; }
|
|---|