You can test it like this, mapping undef to an empty string just for the comparison:
unless ($user || '' and $pass || '') { ... }
Personally, I wouldn't force people into using a password that matches ^\w{8}$ (which you seem to do) - maybe you want a check like 8 <= length $pass and some more checks? Your current way would set my password to "threepig" from "one!threepiggies".
In reply to Re: CGI.pm and Use of uninitialized value in pattern match
by Corion
in thread CGI.pm and Use of uninitialized value in pattern match
by afarber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |