in reply to Re: Internally, how do for() and while() differ?
in thread Internally, how do for() and while() differ?
Um, not quite, thats part of the magic of while not readline
You see <> in scalar context didn't set $_$ perl -MO=Deparse,-p -le "while(<>){print}" BEGIN { $/ = "\n"; $\ = "\n"; } while (defined(($_ = <ARGV>))) { print($_); } -e syntax OK $ perl -MO=Deparse,-p -le "while($f=<>){print}" BEGIN { $/ = "\n"; $\ = "\n"; } while (defined(($f = <ARGV>))) { print($_); } -e syntax OK $ echo hi |perl -le "while($f=<>){print}"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Internally, how do for() and while() differ?
by LanX (Saint) on Oct 27, 2015 at 09:12 UTC |