The variables $fromtodigest and $tofromdigest are both SHA1 digests. It is necessary to include the \Q condition as without it I get an error stating "Unmatched bracket..." where a bracket is one of the symbols in the digest. The idea of this if statement is that if there is a match then the match should be returned. However with the return match brackets in the if statement, even with a known match the program does not enter into the if statement. Without the brackets the program will enter the if statement. But I need the match to be returned!!! Can anyone see what the problem is??if ($cache_ref->{Index}[$i]=~/\Q($fromto_digest)/ or ref->{Index}[$i]= +~/\Q($tofrom_digest)/) { $cache_index=$1; $index_match=1; last; }
In reply to Returning a match by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |