Hi, Bill,

For fast array operations, I like to use map.

Ex:

$testnum = 1;

map { $bool = 'true' if $_ == $testnum } @your_array;

Regards,
John

--
John T Shea
[EMAIL PROTECTED]
 
---- Bill - compuserve <[EMAIL PROTECTED]> wrote: 
> Hi List
> 
> I have an array and all I need to do is to find out if a number is present
> in the array or not.
> 
> Currently I just do a 'foreach' on the array and and check the number
> against the array element. I was wondering if there is any function that can
> do this without the need for me to manually step through each element.
> 
> It works but I suspect it won't scale well for a large number of arrays.
> 
> Any thoughts appreciated
> 
> Bill.
> 
> 
> 
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to