if ($shell ne "" and $shell !~ /false|null/) { # it's ok }