in reply to Re: Creating stub methods
in thread Creating stub methods
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating stub methods
by Aristotle (Chancellor) on Dec 30, 2003 at 08:45 UTC |