in reply to better way to find list members?

Perl FAQ 4, "How can I tell if a list or array contains a certain element?"
Hearing the word "in" is an indication that you probably should have used a hash, not a list or array, to store your data. Hashes are designed to answer this question quickly and efficiently. Arrays aren't.

...


$_="goto+F.print+chop;\n=yhpaj";F1:eval

Replies are listed 'Best First'.
RE: Re: better way to find list members?
by jptxs (Curate) on Oct 17, 2000 at 00:43 UTC

    if not grep and a hash is not a good option for other reasons what would you suggest?

    -- I'm a solipsist, and so is everyone else. (think about it)