|Keep It Simple, Stupid|
Re: AUTOLOAD for variables?by Chmrr (Vicar)
|on Jul 08, 2004 at 04:48 UTC||Need Help??|
It's possible to do, if you hook into the warning that gets tossed when a variable is only used once. For example:
However, this is firmly in the "sick trick" arena, rather than "maintable code." Heed the other monks' advice to look for better ways to go about this.
Update: Oh, yeah -- this obviously only works if you only refer to the variable once in your code. This may be more trouble than it is worth, obviously. It also won't catch things like $foo = "five"; print $$foo;