in reply to Re: A general method of locally overriding subroutines
in thread A general method of locally overriding subroutines
Even so, it's easier to understand than the nested-subroutines solution.sub localize { my $real = pop; no strict 'refs'; goto CALL unless @_; AGAIN: local *{shift@_} = sub { 'changed' }; goto AGAIN if @_; CALL: $real->(); }
I wonder if anybody out there has got something even simpler.
Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A general method of locally overriding subroutines
by BrowserUk (Patriarch) on Mar 11, 2006 at 06:36 UTC | |
by tmoertel (Chaplain) on Mar 11, 2006 at 07:35 UTC | |
|
Re^3: A general method of locally overriding subroutines
by dragonchild (Archbishop) on Mar 11, 2006 at 13:20 UTC |