Use unix newlines

perl -ne 's/\r//g;print'