while() { # get the current line and split into it's columns @Line = split /\s+/, $_; #print the selected columns to the output print OUTFILE join("\t",@Line[@ColumnNumbers]),"\n"; }