in reply to Internally, how do for() and while() differ?
while loops as long a boolean expression is true.
This can be used together with an iterator, like while($x=iter()) .
There is no general automatism to set $_ like your example implies, that's just magic behavior of the file iterator <> in scalar context. that boolean context.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Internally, how do for() and while() differ?
by Anonymous Monk on Oct 27, 2015 at 01:23 UTC | |
by LanX (Saint) on Oct 27, 2015 at 09:12 UTC |