Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is my attempt:
...and it doesn't work. Trawling through man perlre mentions this but I don't understand the solution:if ($source =~ /'\$/s) { push @errors, "possible unescaped sql string"; }
You cannot include a literal $ or @ within a \Q sequence. An unescaped $ or @ interpolates the corresponding variable, while escaping will cause the literal string \$ to be matched. You'll need to write something like m/\Quser\E\@\Qhost/.What is the secret?
Thanks
Steve Woodcock
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: How can I match '$ (literally)
by merlyn (Sage) on Aug 02, 2000 at 17:13 UTC | |
|
Re: How can I match '$ (literally)
by agoth (Chaplain) on Aug 02, 2000 at 15:35 UTC | |
by Anonymous Monk on Aug 02, 2000 at 15:53 UTC | |
|
RE: How can I match '$ (literally)
by mrmick (Curate) on Aug 02, 2000 at 18:10 UTC |