Withigo has asked for the wisdom of the Perl Monks concerning the following question:
no strict 'refs'; # get a copy of the real sub our $real_param = *{"CGI::param"}{CODE}; # automagically create a new sub that contains the old sub *{"CGI::_real_param"} = \&{$real_param}; # override param() *{"CGI::param"} = sub { return Encode::decode_utf8(shift->_real_param(@_)); };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to change the symbol table to wrap a sub in another sub ?
by davido (Cardinal) on Sep 21, 2006 at 18:34 UTC | |
|
Re: How to change the symbol table to wrap a sub in another sub ?
by dtr (Scribe) on Sep 21, 2006 at 18:38 UTC | |
|
Re: How to change the symbol table to wrap a sub in another sub ?
by ikegami (Patriarch) on Sep 21, 2006 at 18:45 UTC | |
|
Re: How to change the symbol table to wrap a sub in another sub ?
by Withigo (Friar) on Sep 21, 2006 at 19:18 UTC | |
by chromatic (Archbishop) on Sep 21, 2006 at 19:37 UTC |