Don't ask to ask, just ask | |
PerlMonks |
Re: Re: chomp() problemsby paulbort (Hermit) |
on Sep 25, 2002 at 21:06 UTC ( [id://200736]=note: print w/replies, xml ) | Need Help?? |
I just ran into this recently with files being FTP'd from Windows to Linux, and I have to agree with Flexx: \r and \n are system-specific, where this is a byte-specific problem.
What I used was similar to charnos' substitution, but fixed to ASCII:
This removes all stray CR/LF from any ASCII to any ASCII. (Sorry, no EBCDIC support.) As long as Perl can figure out where the line breaks are, this will get rid of the odd bits. -- Spring: Forces, Coiled Again!
In Section
Seekers of Perl Wisdom
|
|