in reply to Re: Re: User Existance?
in thread User Existance?

What's the error? As for not complaining about root, perldoc -f getpwnam mentions that the return value is the uid corresponding to the name, or undef if the username does not exist. Root is uid 0, so you really need to check the definedness of the return value:
if(defined(getpwnam($username))) ...
Post the error message and we'll figure it out.

--isotope

Replies are listed 'Best First'.
Re: Re: Re: Re: User Existance?
by The Mad Hatter (Priest) on May 18, 2003 at 00:25 UTC
    I forgot about that little caveat. Thanks for pointing it out. As for the error, it is most likely the lack of parentheses around the conditional for the if statement, as I said before.