Just to throw out another option, you could also use the quotemeta function on your string.
quotemeta EXPR quotemeta Returns the value of EXPR with all non-"word" characters backslashed. +(That is, all characters not matching /[A-Za-z_0-9]/ will be preceded + by a backslash in the returned string, regardless of any locale sett +ings.) This is the internal function implementing the \Q escape in do +uble-quoted strings. If EXPR is omitted, uses $_.
In reply to Re: trouble using the qq operator
by Rich36
in thread trouble using the qq operator with DBI
by costas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |