Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Lexical closures

by backstab (Novice)
on Oct 25, 2008 at 20:45 UTC ( [id://719552]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Lexical closures
in thread Lexical closures

I admit in day-to-day scripts always wanting the foreach element placeholder to be local (in the general sense) to the loop so that having it my'd as far is mandatory as chromatic showed us in the other post.

But, we can imagine some uses in special cases as debugging, introspection or understanding dead code...

I did a quick grep on the perl files I have installed for foreach that seems to use a global "$i". I've only found one, maybe, from perl5db.pl.

It might be an interessing read.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-16 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found