#!/usr/bin/perl use strict 'vars'; use vars qw( @stuff $i @ARGV $fh ); $/ = undef; if (-e "$ARGV[0]"){ open ($fh, "+>>$ARGV[0]"); seek $fh,0,0; @stuff = <$fh>; foreach (@stuff){ $_ =~ s/\r/\n/mig; } seek $fh,0,0; truncate $fh,0; print $fh @stuff; close $fh; print "Done.\n"; } else{ print "Select a file that's actually there.\n"; }