if(!$foo || $foo =~ /\?/){ # either its blank or there is a ? somewhere in it }