# Open both IN_FILE and OUT_FILE here! while() { chomp; next unless length; print OUT_FILE "$_\n"; }