In addition to Athanasius' caveats, realise that when you write "\n" to a text file, the OS will add the "\r" for you.
Thus your advice to use local $/="\r\n"; will result in "\r\r\n" being written if the file is in text mode.
In order to avoid that addition, you must binmode the file. Or remove the :crlf layer from the perlIO stack.
In reply to Re^2: How to print Unix newlines in Strawberry Perl on Windows
by BrowserUk
in thread How to print Unix newlines in Strawberry Perl on Windows
by evgen-i
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |