use strict; use warnings; my $total; while(<DATA>) { my ($county, $year, $yr_tot) = split; $total += $yr_tot if $county =~ /26005/; } print "Total for county 26005: $total\n"; __END__ 26005 2004 1 26005 2004 2 26005 2004 3 26004 2004 1 26003 2004 1
In reply to Re: regular expressions
by si_lence
in thread regular expressions
by pugsly62
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |