in reply to Perl + DBI + mysql - Escaping Strings

The quote method assumes that its argument is a string literal. It can't go through an SQL statement, pick out the parts that look like string literals and then properly quote them. Is that what you're asking?

Quoting is database driver specific. However, you probably can use the same algorithm for most of the commonly used databases. Have a look at the code for sub quote in the file DBI.pm. You'll see that there is some dependence on the database handle, but it is minimal.

Please tell us more about what your circumstances are. If you are given an SQL statement, it should already be well-formed and any embedded string literals already properly quoted.