My favorite switch is -l, and this is why:
perl -i.bak -ple 'BEGIN{$/="\n"}'
gets you from Unix to DOS (or should) and changing "\n" to "\r\n" gets you back.
Update: assuming you're always converting to the system you run the command on, that is--the -l flag gives you native line-endings.
Though of course if you're in MSDOS, you presumably need to fiddle with the quotes some.
In reply to Re: Re: newlines for windows from unix
by ChemBoy
in thread newlines for windows from unix
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |