in reply to
regex search fails
Try
print if /\Q$pattern/
. Since your pattern contains the literal string
'$testVar'
, using the
\Q
escape will prevent it from being interpolated in the match.
Comment on
Re: regex search fails
Select
or
Download
Code
Replies are listed 'Best First'.
Re^2: regex search fails
by
stephanm
(Sexton)
on Mar 12, 2009 at 23:03 UTC
Thanks everyone. The \Q did the trick.
[reply]
In Section
Seekers of Perl Wisdom