123 aBVXC SAOMEWTRINOGN ABC 876 AsrdaDS some_bs 564 37897654 aofruafdouf abc #!/usr/bin/perl -w use strict; open (IN, '<', "tab_file.txt") or die "$!"; while () { my ($first_token) = split (/\s/, $_); #should be(/\t/, $_) print $first_token,"\n"; } __END__ 123 876 37897654 tab_file.txt: (not really tabs)... 123 aBVXC SAOMEWTRINOGN ABC 876 AsrdaDS some_bs 564 37897654 aofruafdouf abc