getpwnam returns undef if the account doesn't exist. Try this:
my $username = SomeSubToGetUsername; my $check = getpwnam($username); if ($check) { # account exists ... } else { # account does not exist ... }
Hope this helps.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: Re: Re: problem of a beginner
by antirice
in thread Parsing and verifying login for a CGI form
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |