Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 contemplating the Monastery: (11)
As of 2014-09-22 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (193 votes), past polls