in reply to Does this user exist?
Some users will not have a home directory under /home. Much better is to see whether they exist in /etc/passwd. For this, you need to use getpwnam. For instance:
my $dir = ((getpwnam($user))[7]);... will return the home directory, wherever it may be, of the user. If getpwnam returns undef, then you are certain that the user does not exist on your system. (But think a while about what happens when two people ask to register the same name)...
|
|---|