my $sql = "SELECT * FROM $log"; ### Add this print ### print "get_columns sub just before prepare: \$sql = $sql\n"; $sth = $dbobject->prepare($sql);