@input = (); $string = "abc"; push(@input, '%' . $string . '%'); $sth=$dbh->prepare("SELECT * FROM table WHERE field LIKE ?") or die $dbh->errstr; $sth->execute(@input) or die $dbh->errstr;