my $dbh = DBI->connect( $whatever… ) ... my $sth = $dbh->prepare( "select field from table where id != ?" ); $sth->execute( '$in{cid}' ); # an 8-character string is the placeholder value ... #### my %in; $in{cid} = "something"; my $dbh = DBI->connect( $whatever… ) ... my $sth = $dbh->prepare( "select field from table where id != ?" ); $sth->execute( $in{cid} ); # the hash element value is the placeholder value ...