open(my $in, '<', $ARGV[0]) or die $!; unlink($ARGV[0]); open(my $out, '>', $ARGV[0]) or die $!; while (<$in>) { s/\r\n/\n/; print($out $_); }