Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning a match
by pfaut (Priest) on Mar 11, 2003 at 16:00 UTC | |
|
Re: Returning a match
by Tomte (Priest) on Mar 11, 2003 at 15:56 UTC | |
|
Re: Returning a match
by ihb (Deacon) on Mar 11, 2003 at 15:57 UTC |