Home : General : Perl Programming :

General: Perl Programming: Re: [courierb] push new element to array: Edit Log

Here is the list of edits for this post
Re: [courierb] push new element to array
Hi,

If you want to lookup a key of a hash, this should work

Code:

#@myNames = ('Moe', 'Shemp', 'skie','blah');
$newduserid=newuseridentered
%myNames = (
userid1 => Moe, 20, male
userid2 => Shemp, 30,male
userid3, => skie, 40,,male
userid4 => blah ,50,male);


if (exists $myNames{$newduserid}){
print" $userid1 is most probabley has been registed before. \n";

}else{ print
print" you are encouraged to registe again. \n";
}


I hope that is what you want.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog

Last edited by:

tandat: Oct 1, 2007, 5:37 AM

Edit Log: