my $stmt = "SELECT * FROM $table WHERE $key_col = '$key_val'"; my $sth = $dbhandle->prepare( $stmt ); $sth->execute();