in reply to Quick 'Quote' DBI Question

There are several ways to handle this - placeholders, DBI's quote method or the q{} operator.

$name = $dbh->quote( $name );

-derby

Replies are listed 'Best First'.
Re^2: Quick 'Quote' DBI Question
by roboticus (Chancellor) on Apr 06, 2007 at 13:35 UTC
    derby: ++!

    Update: Oops! Herkum beat me to the punch!/Update

    Seconded! You should definitely check out the placeholder syntax, as it fixes these problems for you. Something like the following should work for you:

    my $SQL = "SELECT col1, col2 FROM table WHERE lastname=?"; my $ST = $DB->prepare($SQL) or die; $ST->execute($last_name) or die;
    ...roboticus