Coder's Guild Mailing List

HASHES in perl

Posted by Frank Hale on 1999-10-11

Once again here we go. Okay I have a hash with the
keys as usernames and the values as passwords. Okay
the value in $userdata{"name"} == frank and if I try
to find it in the hash with the following code it will
not work. However I can print off all the values and
it is definitely in there but I cannot get it to find
it when using an if statement. What am I doing wrong?

foreach $user (keys %USERS) 
{ 
	if ($userdata{"name"} eq $USERS{$user}) { print
"cool"; }
}



=====
From: Frank Hale
ICQ: 7205161
Webpage: http://jade.netpedia.net/sapphire
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com