open my $infh, "<", "old.txt" or die $!; open my $outfh, ">", "new.txt" or die $!; <$infh>; # Discard the first line while (<$infh>) { chomp; s/\t/\n/; print {$outfh} "$_\n"; } close $infh; close $outfh;