in reply to Getting the right count
#!/usr/bin/perl use warnings; use strict; my $count=0; while (<DATA>) { # default split is /\s+/ which includes \t # white space characters are: \t\f\r\n and space my ($perfNum) = split; #first token of split $count++ if ($perfNum > 600); } print "count of perfNums > 600: $count\n"; #prints: count of perfNums > 600: 3 __DATA__ 10 alpha 30 bravo 60 charlie 100 delta 500 echo 600 foxtrot 4 golf 22 hotel 900 igloo 800 juliet 999 kilo
|
|---|