Hi ! I'm new in perl. Currently I'm developing a small online shop system. The script reads from a plain text database each line as one product. if you order a product, the line index is written into a hidden field and added to the other indexes in this field. if you want to remove an item I just replace the line index by ''. To prevent matching errors I'm adding '#'
before and after the index. now I've got a problem: If the user want to add the same product two times, my script doesn't catch this:
$art is the value of the Button (can be delete, too)
$artikel is the value of the hidden field where all the indexes are in
$artindex is the index to add, or to delete or not to add
if ($art eq 'Bestellen')
$temp = "\#$artindex\#";
if ($temp =~ $artikel) #<--- This doesn't work !
$artindex =~ s/\#//g;
$temp = &GetEntry($artindex,1);
&info ("Folgender Artikel wurde bereits von Ihnen in den Warenkorb gelegt\:\<br\>\"$temp\"");
$artikel = "$artikel\;\#$artindex\#";
I just want to check, if #$artindex# is already in $artikel, why doesn't it work ???