in reply to Re: How to find out if X is an element in an array?
in thread How to find out if X is an element in an array?
This may be simplistic, but what about the following code. Anyone?
# # Given: first value passed is the element to check for # Given: remaining values are the array to check in # sub find_in_list { my ($element, @list2check) = @_; return(scalar(grep($element, @updatelist))); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Answer: How to find out if X is an element in an array?
by juliansnail (Initiate) on Apr 07, 2004 at 00:08 UTC |
In Section
Seekers of Perl Wisdom