open (INPUT, "<", "input.txt"); while (){ chomp(my $record = $_); print join ",", (split /\t/, $record); }