Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Why? Because it solves a simple problem in a complex and convoluted way.
Somebody could mess with the package global $FOO_HAS_BEEN_CALLED and blow things up The "somebody could mess with it" argument has never been valid for Perl. Of course somebody could mess with it! Somebody could mess with absolutely everything in your program. If you want to prevent possible accidental changes, you could make it a lexical instead and let foo() be a closure around it. But no one mentioned security as the reason for this. I still think it sounds like setup code that should be in some kind of BEGIN or INIT block. In reply to Re^3: Is modifying the symbol table to redefine subroutines evil?
by perrin
|
|