Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Re: Re: Removing the ^M character, but also removing the newline

by steves (Curate)
on Dec 30, 2001 at 03:05 UTC ( [id://135168]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Removing the ^M character, but also removing the newline
in thread Removing the ^M character, but also removing the newline

Almost forgot. I wrote this simple dos_chomp function for cases where there may or may not be a CR (^M) before the LF. Enjoy!

sub dos_chomp { if (!defined(@_[0])) { chomp; s/\r$//; } else { for (@_) { chomp; s/\r$//; } } return wantarray ? @_ : @_[0]; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found