return 1 if (! $user ) or ( $user eq '' ); # No user! return 2 if (! $domain ) or ( $domain eq '' ); # No domain! # The second part of these lines is *never* looked at. If $user ='' # then !$user is true and they return without ever evaluating the # bit past the or. You don't need the parents either. return 1 if ! $user ; # No user! return 2 if ! $domain; # No domain! # The if ! (if-not) syntax is what unless was invented for return 1 unless $user; # No user! return 2 unless $domain; # No domain!