Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Internally, how do for() and while() differ?

by LanX (Saint)
on Oct 27, 2015 at 09:12 UTC ( [id://1146080]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Internally, how do for() and while() differ?
in thread Internally, how do for() and while() differ?

I meant while's scalar context, and only this iterator.

Should be documented ( perlsyn ? )

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

UPDATE

see perlop#IO-Operators :

> If and only if the input symbol is the only thing inside the conditional of a while statement (even if disguised as a for(;;) loop), the value is automatically assigned to the global variable $_ , destroying whatever was there previously.

  • Comment on Re^3: Internally, how do for() and while() differ?

Log In?
Username:
Password:

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

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

    No recent polls found