if ( ! defined $users{$user} ) { # user not defined within the %users hash
} Wags ;) -----Original Message----- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Monday, November 26, 2001 22:59 To: [EMAIL PROTECTED] Subject: Checking to see if $user exists in a hash. Hey all, I have just created the hash that looks like this.... %users = ( 'uucp' => '14', 'daemon' => '2', 'daniel' => '45', 'test2' => '45', 'halt' => '0', 'test4' => '45' ); $user = "test4"; Now here I want to see if $user exists in the hash... if it doesnt then I want it to return an error. What would be the best way of going about this? Really confused.... Dan ============================== VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW: http://www.vintek.net Tel: (08) 8523 5035 Fax: (08) 8523 2104 Snail: P.O. Box 312 Gawler SA 5118 ============================== -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]