ibjdt
Programmer
- Nov 25, 2002
- 63
i have a flat file with this configuration
customerID::itemCode::month.yr::#ofSearches
the #ofSearches is a running total for each itemCode - by customerID - in the correpsonding month.yr
in an admin script i try to extract each itemCode with the total #ofSearches in the current month (for all customers -- in later admin screens i break it down specifically by customer)
but i get the error
Modification of a read-only value
related to the way i try to add the #ofSearches:
any suggestions are greatly appreciated.
thanks.
customerID::itemCode::month.yr::#ofSearches
the #ofSearches is a running total for each itemCode - by customerID - in the correpsonding month.yr
in an admin script i try to extract each itemCode with the total #ofSearches in the current month (for all customers -- in later admin screens i break it down specifically by customer)
but i get the error
Modification of a read-only value
related to the way i try to add the #ofSearches:
Code:
open (BPNSEARCH, "data/Bpnsearch.txt");
@bpnsearch = <BPNSEARCH>;
close (BPNSEARCH);
foreach $bpnsearch (@bpnsearch)
{
chomp ($bpnsearch);
@bpnsearch2=split(/::/,$bpnsearch);
######THIS IS WHERE I GET THE ERROR
#CREATE VAR OF EACH ITEMCODE AND INCREMENT BY #OF SEARCHES
${$bpnsearch2[1]} += $bpnsearch2[3];
#####
foreach $bpnsearch (@bpnsearch)
{
chomp ($bpnsearch);
@bpnsearch2=split(/::/,$bpnsearch);
#STORE EACH INCREMENT FROM ABOVE IN TEMP FILE FOR USE LATER
unless($i{$bpnsearch2[1]}++)
{
push(@Tbpnsearch, "${$bpnsearch2[1]}\::$bpnsearch2[1]\n");
}
}
any suggestions are greatly appreciated.
thanks.