in reply to UNIVERSAL::can and autoloaded methods
Here is a cheap alternate solution that involves poking into internals:
This is basically what you have already but it avoids actually calling the method.sub load_in_cgi { my $func = shift; eval { local $CGI::AUTOLOAD = $func; CGI::_compile(); }; }
The third approach is to use isa and fallback on can. That is, assume that any CGI object will do what you want, but be willing to accept just having the methods. That avoids having to poke around in internals.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: UNIVERSAL::can and autoloaded methods
by cees (Curate) on Dec 01, 2003 at 19:12 UTC |