If you're paranoid, and not certain that the table name can be interpolated directly, you also might want to consider using quote_identifier to quote the table name for the select.
Untested code...
my $quoted_table = $dbh->quote_identifier($table); my $sth = $dbh->prepare(qq{SELECT * FROM $quoted_table}) or die "Can't prepare statement: $DBI::errstr";
In reply to Re^2: Dynamically passing table names to a sql query(DBI)
by adrianh
in thread Dynamically passing table names to a sql query(DBI)
by brajan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |