Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-03-29 03:33 GMT
Find Nodes?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:

    Results (630 votes), past polls