in reply to use FileHandle, readdir???

Consider your error: there is only one variable on that line, so it must be undefined. A better question you should be asking is "Why didn't my open work?" I would suggest testing your open:

my $NuserDir = new FileHandle "+>> /home/$key" or die "Open failed: $!";

I strongly suspect that you either don't have permissions for the requested operation or you are trying to clobber a directory.

On a side note, after you fix that, you still won't function since readdir needs a directory handle, not a file handle.