in reply to trouble using the qq operator with DBI

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 $_.

Rich36
There's more than one way to screw it up...

Replies are listed 'Best First'.
Re: Re: trouble using the qq operator
by kappa (Chaplain) on Apr 08, 2002 at 14:00 UTC
    It's probably good to encourage use of quote function from DBI, because quotemeta function does not know anything about a particular database server requirements for quoting, while DBI::quote is an encapsulation and is able to quote just what needs to be quoted.
      Very good point... That could definitely cause problems with certain databases.
      Rich36
      There's more than one way to screw it up...