Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Lexical closures

by backstab (Novice)
on Oct 25, 2008 at 20:45 UTC ( #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
Node Status?
node history
Node Type: note [id://719552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2019-07-16 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?