Unix to DOS: perl -i -pe 's/\012/\015\012/g' unix-file DOS (Mac? I'm so confused) to Unix: perl -i -pe 's/\015\012/\012/g' mac-file