in reply to Re: perl leaving out the last value?
in thread perl leaving out the last value?
while (defined($symbol = <IN>))
With this particular construct, Perl automatically adds the defined(), so you can safely omit it if you prefer brevity.
$ perl -MO=Deparse -e'while ($symbol = <IN>) { chomp($symbol) }' while (defined($symbol = <IN>)) { chomp $symbol; } -e syntax OK
|
---|
In Section
Seekers of Perl Wisdom