Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Interesting Use for "state" Variables

by liverpole (Monsignor)
on Mar 10, 2009 at 08:38 UTC ( [id://749528]=note: print w/replies, xml ) Need Help??


in reply to Re: Interesting Use for "state" Variables
in thread Interesting Use for "state" Variables

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$..$/
  • Comment on Re^2: Interesting Use for "state" Variables

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://749528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-18 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found