while () { tr/\r\n//d; # even better than chomp! print join( "\t", ( split /\t/ )[@ARGV] ), "\n"; } #### while() { last if /\t/; } die "No tab-delimited fields found\n" unless ( /\t/ );