laziness, impatience, and hubris | |
PerlMonks |
Re^3: Changing CRLF in Windows to LF for UNIXby pwagyi (Monk) |
on Nov 02, 2018 at 08:36 UTC ( [id://1225087]=note: print w/replies, xml ) | Need Help?? |
You should use 3 arg open FILEHANDLE,MODE,EXPR. I tried out the code and it does work for me. >> I'm coding in Windows (Windows 10) and trying to change a Windows created text file that ends in CRLF to just LF, so that I can upload the file and process it on a Unix-based site. If you are running the script in Windows, it will happen since when you open for write (without binmode or :raw or :unix), Perl will perform '\n' to (Windows) platform '\r\n'.
In Section
Seekers of Perl Wisdom
|
|