#prepare my $sth = $dbh->prepare('SELECT * FROM people WHERE lastname = ? AND firstname = ?'); #execute with list of bindvars $sth->execute( $lastname, $firstname ); [download] But it's a bit cumbersome to adjust the bind values if the order changes. #### $dbh->{pg_placeholder_dollaronly} = 1; # default is 0 my $sth = $dbh->prepare('SELECT * FROM people WHERE lastname = $1 AND firstname = $2');