more useful options | |
PerlMonks |
Re^2: Interesting Use for "state" Variablesby liverpole (Monsignor) |
on Mar 10, 2009 at 08:38 UTC ( [id://749528]=note: print w/replies, xml ) | Need Help?? |
Yes, you're right. That "fly in the ointment" just now occurred to me, and I was going to update my post to point this out. It unfortunately makes many applications (such as tracking line numbers from a file) useless, except for the very first time. Rats.
It brings me back to a previous thought -- I wonder what it would take to implement a special Perl variable to track the loop count? For example, $* is now deprecated; perhaps it could be "reused" for something like this? Anyway, thank you for finding my flaw early on. s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Meditations
|
|