use warnings; use strict; my $cnt = 0; while () { chomp; my ($an, $dist) = split; $cnt++ if $dist < 10; } print "cnt=$cnt\n"; __DATA__ a 50 b 15 c 9 d 11 e 33 f 2 #### cnt=2