#!/usr/bin/perl # convert a dos \r\n format to unix \bn open (FILE, $ARGV[0]); while () { # remove the stupid \r, replace with \n # some broken editors just put \r s/\r/\n/g; # Remove the duplicate \n s/\n\n/\n/g; print; }