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]; }
|
|---|