@@ -, +, @@ fails on undefined By moving the string substitution inside an existing if statement, the string substitution succeeds. And if it was null, a string substitution would leave it null. In the case that it is 0 or '0', it doesn't have whitespace, and so the substitution doesn't need to be run. --- C4/Breeding.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/C4/Breeding.pm +++ a/C4/Breeding.pm @@ -179,9 +179,9 @@ sub BreedingSearch { $query .= "z3950random = ?"; @bind=($z3950random); } else { - $search =~ s/(\s+)/\%/g; @bind=(); - if ($search) { + if ($search) { + $search =~ s/(\s+)/\%/g; $query .= "title like ? OR author like ?"; push(@bind,"%$search%", "%$search%"); } --