I am writing a cgi script that allows input from a user to add a username in a formfield. I was using
my $uid = getpwnam("$username"); to grab the uid of the user submitted. This worked well enough, until I was testing to see what happened when "root" was placed in the user field. Since the uid for root is "0", the $uid value was coming back as false and appearing as though the user didnt exist. Is there a(nother| better) way to test for the existance of a user that will encompass 'root'?
humbly -c