On Tue, 11 Feb 2003 17:31:42 +, Felix Geerinckx wrote:
> on di, 11 feb 2003 17:22:20 GMT, Dan Muey wrote:
>
>> if(exists $hash{$key}) { ... }
>>
>> is there a way to do that with arrays?
>> IE
>> if there is an array element that is 'bob' then do this ::
>> without having to do a foreach on
> > Unless the arrays become too big,
> > grep is your friend
> > (perldoc -f grep)
>
> According to the FAQ I mentioned in another reply, it isn't ;-)
yep, i spoke to soon as well. grep has always worked well for me.
so there is the quick and dirty way, then the right way :)
from the faq:
Ple
> if(exists $hash{$key}) { ... }
>
> is there a way to do that with arrays?
> IE
> if there is an array element that is 'bob' then do this ::
> without having to do a foreach on the array
>
> basically an easier/better/faster/ way to do this :
>
> @search_for_these =
> @search_me =
on di, 11 feb 2003 15:54:36 GMT, Janek Schleicher wrote:
> On Tue, 11 Feb 2003 11:22:20 -0600, Dan Muey wrote:
>
>> is there a way to do that with arrays?
>> IE
>> if there is an array element that is 'bob' then do this ::
>> without having to do a foreach on the array
>
> Unless the arrays beco
on di, 11 feb 2003 17:22:20 GMT, Dan Muey wrote:
> if(exists $hash{$key}) { ... }
>
> is there a way to do that with arrays?
> IE
> if there is an array element that is 'bob' then do this ::
> without having to do a foreach on the array
See
perldoc -q "array contains"
in the Frequently
On Tue, 11 Feb 2003 11:22:20 -0600, Dan Muey wrote:
> is there a way to do that with arrays?
> IE
> if there is an array element that is 'bob' then do this ::
> without having to do a foreach on the array
Unless the arrays become too big,
grep is your friend
(perldoc -f grep)
If they become too
Withh a hash you can do
if(exists $hash{$key}) { ... }
is there a way to do that with arrays?
IE
if there is an array element that is 'bob' then do this ::
without having to do a foreach on the array
basically an easier/better/faster/ way to do this :
@search_for_these =
@search_me =