MLUG: Re: [UUG/MLUG] perl question fo the day
Re: [UUG/MLUG] perl question fo the day
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Thu, 7 Oct 1999, Routier, Daniel J. wrote:

> Suppose I have
> 
> @blah = (1,2,3,4);
> $bleh = 3;
> 
> And i want to find out if $bleh is a member of @blah.
> as in part of a conditional statement,
> 
> if ($bleh is in @blah) {
>   etc
> }
> 
> How would you do that conditional?  I am finding no reference to it in the
> manual so far :(
> I'm assuming there is a way rather than looping through @blah searching for
> $bleh.

Nope.  Not afaik.

You *could* use a hash to make things easier though.

-Tymm

> 
> Daniel J Routier
> Programmer / Analyst
> Student Financial Aid
> University of Missouri
>