http://www.perlmonks.org?node_id=1096487

fiona has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I am very new to Perl and am trying to update a pretty old shopping cart script to be able to show the info for estimating shipping. I have it almost all working the way I want but for some reason one of my variable when its updated instead of replacing the value it appends the new value on the end and comma separates. The code is identical to that used for another variable and that seems to function fine. I have included what are hopefully the relevant code sections below. Any input would be appreciated. Thanks
print "To estimate shipping please enter shipping country to generate +information for Fedex calulations then click estimate shipping to ope +n Fedex Estimator :<br> \n"; print "<input name=shipcountry value=$shipcountry>\n"; print "<input type=submit value=\"Show Shipping Info\"><br>\n"; open (REFFILE,"$reffile") || print "Content-type: text/html\n\n Can't +Open $reffile(r): $!\n"; my(@LINES)=<REFFILE>; close(REFFILE); $SIZE=@LINES; open (REFFILE,">$reffile") || print "Content-type: text/html\n\n Can't + Open $reffile(r): $!\n"; print REFFILE "$date\| $ENV{'REMOTE_HOST'}\| $ENV{'HTTP_USER_AGENT'}\| +$FORM{'discnt'}\|$FORM{'shipcountry'}\|\n";