Think about Loose Coupling | |
PerlMonks |
Static variables (oh, the horror())by ChemBoy (Priest) |
on May 21, 2003 at 22:07 UTC ( [id://259912]=note: print w/replies, xml ) | Need Help?? |
BTW, the static trick only works with if 0; and for (); Not so. Observe:
(Not that the sub name is intended as an editorial comment, or anything... <grin>) The nasty part is just that the cleanup (resetting $foo to undef) takes place at the end of the iteration in which my $foo is actually executed (which isn't exactly what you'd expect from a "reset" argument, but that's what you get with silly example code). If God had meant us to fly, he would *never* have given us the railroads. --Michael Flanders
In Section
Meditations
|
|