Buckaroo Buddha has asked for the wisdom of the Perl Monks concerning the following question:
$key = "INITIAL.LASTNAME,INITIAL2.LASTNAME2,INITIAL3.LASTNAME3"; $key2 = "INITIAL.LASTNAME,INITIAL2.LASTNAME2,."; if ($key =~ m/$key2/){ print " [just another perl hacker] \n"; }
i'm cycling through two hash tables and trying to get the exact match but it seems that i have a less than perfect understanding of pattern matching i've got "the perl cookbook" here with me, so if i find the answer before this is taken care of i'll post a reply to myself but i expected that the above statement would evaluate to FALSE (note, i'm not actually making an attempt at a JAPH but i thought it was a funny replacement for Execute Block ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching: why does the following code evaluate true? (and how do i fix it?)
by btrott (Parson) on May 31, 2000 at 02:53 UTC | |
|
Re: pattern matching: why does the following code evaluate true? (and how do i fix it?)
by Buckaroo Buddha (Scribe) on May 31, 2000 at 02:57 UTC | |
by reptile (Monk) on May 31, 2000 at 03:17 UTC | |
|
RE: pattern matching: why does the following code evaluate true? (and how do i fix it?)
by Adam (Vicar) on May 31, 2000 at 02:42 UTC | |
by takshaka (Friar) on May 31, 2000 at 02:56 UTC |