Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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


Comment on Re^2: perl leaving out the last value?
Select or Download Code

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 lurking in the Monastery: (8)
As of 2014-08-23 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls