dos2unix < foo.xml > fooOK.xml #### for my $hardcoded ( chr(13) . chr(10), chr(10) . chr(13)) { s/$hardcoded//g: }