#!/usr/bin/perl use Modern::Perl; # 945665 my $count=0; my $num; my @arr = <DATA>; for (@arr) { $num=0; # nul $num to avoid probs from persistenc +e in $1 if ($_ =~ /(\d+)/ ) { # as an alt to splitting on the tab $num = $1; } if ($num > 600) { say "$num > 600ms"; # OP didn't ask for this, but /me # likes visual confirmation in the output $count++; } else { next; } } say "\t count: $count;" __DATA__ 10 alpha 30 bravo 60 charlie 100 delta 500 echo 600 foxtrot 4 golf 22 hotel 900 igloo 800 juliet 999 kilo
In reply to Re: Getting the right count
by ww
in thread Getting the right count
by dukea2006
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |