print $out_fh $line ; #No need to chomp - we print the "\n" #### $line =~ s/\s+$//; $line = "$line\n";