That wouldn't work if the sub is AUTOLOADED, and the package doesn't redefine 'can' to reflect this. (I've seen many packages using AUTOLOAD that don't redefined 'can').
It also won't work if you've edited the Perl source code and removed support for AUTOLOAD, which also produces broken behavior. Using AUTOLOAD without predeclaring your subs or overriding can() is a bug.
In reply to Re^7: Using a scalar as a constant?
by chromatic
in thread Using a scalar as a constant?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |