in reply to Using CGI.pm params to make a DBI MySQL query
I like to use prepare and all that gunk, even for INSERTs, but you can still use placeholders with do :
$dbh->do("INSERT INTO tbl VALUES (?,?,?)", undef, @params{qw(Col1 Col2 + Col3)});
This gives you quoting of the values (nice from a security point of view). And the hash slice is just icing on the cake.HTH!
perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
|
|---|