in reply to regex and getpwent()...

Your first regex is done on $shell, but the second two are done on $_. I think you want to take an approach like:
if ($shell ne "" and $shell !~ /false|null/) { # it's ok }
You could, of course, keep the other two regexes separate:
if ($shell ne "" and $shell !~ /false/ and $shell !~ /null/) { # it's ok }
Also, the pattern // does NOT match empty strings -- it uses the last matched pattern again:
"foo" =~ /foo/; print grep //, qw( bar foobar ); # foobar
To match empty strings, either use /^$/ or /^\z/, depending on your definition of empty.

japhy -- Perl and Regex Hacker