Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: perl leaving out the last value?

by Eliya (Vicar)
on Apr 17, 2012 at 22:14 UTC ( #965564=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2016-10-01 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (575 votes). Check out past polls.