cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
Problem is, if the match variable contains a regexp special character, like $, it doesn't match. I need to get it to interpret the variable-substituted string literally.if ($items[$i][3] =~ /\b$lastitem[3]\b/) { print "DUPLICATE\n"; $dupcount++; }
Some kind monks helped me out with a similar problem on the replace side of a substitute statement in this thread, but I can't seem to make the same technique work in the above case. Anyone know how I can solve this problem?
Many thanks
Steve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp variable substitution problem in match
by saintmike (Vicar) on Aug 28, 2005 at 01:15 UTC | |
|
Re: Regexp variable substitution problem in match
by polettix (Vicar) on Aug 28, 2005 at 01:22 UTC |