in reply to Removing ^M char AKA dos2unix

Also have a look at File::LocalizeNewlines