in reply to Re: truth in while conditionin thread truth in while condition
I'd rather use an explicit last with condition inside the body.
use strict; use warnings; use feature 'say'; while ( $_= <DATA>, chomp, $_) { say; } __DATA__ 3 1 0 2 [download]
3 1 [download]
(NB: Iterators don't necessarily loop over lines where they need to chomp, <update see here>)
Cheers Rolf (addicted to the Perl Programming Language :) Wikisyntax for the Monastery FootballPerl is like chess, only without the dice