in reply to Numerical value of strings
That should iterate over your $database file, split on pipe characters, match for digits on the 4th column and then add that to $total.open(DB, $database) or die "Error opening file: $!\n"; my $total = 0; while(<DB>) { my($val) = (split /\|/, $entry)[3] =~ /(\d+)/; $total += $val; } close DB;
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Numerical value of strings
by flounder99 (Friar) on Aug 05, 2003 at 16:22 UTC | |
by Limbic~Region (Chancellor) on Aug 05, 2003 at 19:56 UTC |