mgdude has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, Carl# ex. one database file - if (-e $database) { open(DB, $database) or die "Error opening file: $!\n"; while(<DB>){ push @results, $_; } close (DB); foreach $entry (@results){ # at this pt. $p_data[3] may look like " 7" my ($key, @p_data) = split(/\|/,$entry); # $p_data[3] sometimes added to $total w/ numerical value of 0 $total += $p_data[3]; } # do some other stuff with $total... blah, blah, blah }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Numerical value of strings
by cianoz (Friar) on Aug 05, 2003 at 15:15 UTC | |
|
Re: Numerical value of strings
by broquaint (Abbot) on Aug 05, 2003 at 15:13 UTC | |
by flounder99 (Friar) on Aug 05, 2003 at 16:22 UTC | |
by Limbic~Region (Chancellor) on Aug 05, 2003 at 19:56 UTC | |
|
Re: Numerical value of strings
by RMGir (Prior) on Aug 05, 2003 at 15:18 UTC | |
|
Re: Numerical value of strings
by mgdude (Novice) on Aug 05, 2003 at 15:33 UTC | |
by RMGir (Prior) on Aug 05, 2003 at 15:59 UTC | |
|
Re: Numerical value of strings
by thinker (Parson) on Aug 05, 2003 at 15:25 UTC |