[nzlug] quoting perl strings

Simon Green simon at simongreen.net
Mon Oct 1 11:21:40 NZST 2007


On 01/10/2007, Glenn Enright <glenn.enright at gmail.com> wrote:
> On 01/10/2007, Simon Green <simon at simongreen.net> wrote:
> > use DBI (and the DBD for your database), and you won't need to worry
> > about quoting at all. A way over simplified example is
> > $dbh->do("INSERT INTO example (col1, col2) VALUES (?, ?)", undef,
> > $string1, $string2);
>
> So this would work for te cas where $string1 has double or single quotes?

Yes.

  -- simon



More information about the NZLUG mailing list