Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: removing carriage returns

by Parham (Friar)
on Mar 29, 2002 at 15:11 UTC ( #155257=note: print w/replies, xml ) Need Help??


in reply to removing carriage returns

also (it's easier to understand, but you adding more code), just an alternative...
while ($requests = <REQUESTS>) { chomp $requests; #remove any endline characters if ($requests ne "") { #if all endline characters are wiped, check f +or nothingness print MAIL "$requests\n"; } }
EDIT. RMGir got me good. Sorry for the mistake. (didn't put my newlines back in)

Replies are listed 'Best First'.
Re: Re: removing carriage returns
by RMGir (Prior) on Mar 29, 2002 at 15:17 UTC
    Don't forget to put the newline back in, though...
    while ($requests = <REQUESTS>) { chomp $requests; #remove any endline characters #if all endline characters are wiped, #check for nothingness if ($requests ne "") { # add newline for lines we're printing print MAIL "$requests\n"; } }

    --
    Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://155257]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2016-12-09 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.