George_Sherston has asked for the wisdom of the Perl Monks concerning the following question:
I feel that none of these is the canonical way. (1) is too messy and buggable, whilst (2) and (3) involve seemingly needless proliferation of variables. I'd be very glad to see how the mighty ones do it.(1) my $dbh->do("INSERT INTO tbl VALUES (".param('Col1').",".param('Col2') +.",".param('Col3').")"); (2) my $Col1 = param('Col1'); my $Col2 = param('Col2'); my $Col3 = param('Col3'); my $dbh->do("INSERT INTO tbl VALUES ($Col1,$Col2,$Col3)"); (3) my %params = Vars; my $dbh->do("INSERT INTO tbl VALUES ($params{'Col1'},$params{'Col2'},$ +params{'Col3'}')");
|
|---|