my ( $name, $passwd, $uid, $gid, $qutoa, $comment, $gcos, $dir, $shell, $expire ) = getpwent($account); # An account *must* have a UID, so let's check that if ( defined $uid ) { print "User $account uid=$uid. OK to delete user!\n"; } else { print "User $account does not exist...\n"; }