Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^7: Using a scalar as a constant?

by chromatic (Archbishop)
on Oct 15, 2008 at 17:27 UTC ( [id://717282] : note . print w/replies, xml ) Need Help??


in reply to Re^6: Using a scalar as a constant?
in thread Using a scalar as a constant?

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.