Actually, I think the "use subs" declaration solves the problem I was looking at, though I kind of like your "subs::i" idea. And you're right that it would be nice if CGI.pm provided a "can" method, but so many people use UNIVERSAL::can() directly that I think simply predeclaring the subs would be easier.
Update: What I think is really nifty about the subs pragma is the line:
*{"${callpack}::$sym"} = \&{"${callpack}::$sym"};We create the slot in the typeglob, but assign an undefined value. $module->can($method) works because we have the slot, but AUTOLOAD still gets called because there is no actual subroutine or method there. Nifty!
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Re: Creating stub methods
by Ovid
in thread Creating stub methods
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |