sub find_entries { my ($this, $that, $other) = @_; my $sth = $dbh->prepare("SELECT * " . "FROM foo " . "WHERE this " . "LIKE '%" . "?" . "%' " . "AND that " . "LIKE '%" . "?" . "%' " . "AND other " . "LIKE '%" . "?" . "%'"); $sth->bind_param(1, $this); $sth->bind_param(2, $that); $sth->bind_param(3, $other); $sth->execute(); ... return $entries; }