On Fri, 30 Nov 2001, Andre` Niel Cameron wrote: > I am having a bit of a problem. Does anyone have any idea how I could have > a variable and see if the value of that variable is also located in an array > and hash? IE: > > $myvar= 6 > > @myarray= ("4", "7", 10", 6") > > if (6 exists in @myarray) ( > dothis} > else{ > dothis}
foreach (@myarray) { if ($_ == $myvar) { #do something } else { #do something else } } -- Brett http://www.chapelperilous.net/ ------------------------------------------------------------------------ Rebellion lay in his way, and he found it. -- William Shakespeare, "Henry IV" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]