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

Re: Empty STDIN does not exit while loop

by choroba (Cardinal)
on May 20, 2017 at 07:59 UTC ( [id://1190702]=note: print w/replies, xml ) Need Help??


in reply to Empty STDIN does not exit while loop

chomp returns the number of characters removed. If you entered the "empty string" by pressing <Enter> , then chomp removes the newline and returns 1.

Using chomp in a while condition is usually not what you want. It'd skip the last line of a file if it didn't end in a newline.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-28 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found