# ex. one database file - if (-e $database) { open(DB, $database) or die "Error opening file: $!\n"; while(){ 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 }