Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
well except:
$blah = (1,2,3,4);
$bleh = 7;
if (grep(EMAIL:PROTECTED)) {
print "yay!\n"
}
it prints yay =)
-----Original Message-----
From: Scott K. Laws [mailto:EMAIL:PROTECTED]
Sent: Thursday, October 07, 1999 11:30 AM
To: EMAIL:PROTECTED
Subject: Re: [UUG/MLUG] perl question fo the day
EMAIL:PROTECTED:~
$ perl -e ' @blah = (1,2,3,4);
$bleh = 3;
if (grep(EMAIL:PROTECTED)) {
print "yay\n";
}
'
map works too
Scott
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.
>
> Daniel J Routier
> Programmer / Analyst
> Student Financial Aid
> University of Missouri
>