Replace in place with perl – converting windows to unix line ending

$ cat -e test.txt 
mop^M$
mip^M$
$ perl -pi -e "s/\r\n$/\n/g" test.txt
$ cat -e test.txt                  
mop$
mip$