Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: When is $_ local and when is it not?

by HyperZonk (Friar)
on Jul 13, 2001 at 17:21 UTC ( #96380=note: print w/ replies, xml ) Need Help??


in reply to When is $_ local and when is it not?

I'll admit that this is pretty much just a guess. I think it may have something to do with the fact that the for construction essentially builds a list from <DATA>, which it then iterates over, while while pumps the data items one at a time into $_. I could very well be very wrong, but I think this may be a place to start looking for an answer.
update: In looking at converter's reply in the thread, I see that the correct answer is given there. I wonder if that has something to do with the fact that the for construction builds a hidden list? Perl_guts wizards can fill us in, perhaps.


Comment on Re: When is $_ local and when is it not?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-07-29 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (266 votes), past polls