in reply to Re^2: syntax error when using bind_param
in thread syntax error when using bind_param

In the second example, you're using a literal as the value, but it's still attempting to use a placeholder (the ?) for the table name, which is what can't be done. Unfortunately, you have to construct or query with the table name:
$qry = "SELECT * FROM $table";
May or may not help in your case, but a very handy module is SQL::Abstract.