Re: List checking
[email protected] (James Ponder) Mon, 25 Sep 2000 12:19:52 +0100
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Sep 25, 2000 at 10:12:07PM +1100, Ian Fitzgerald wrote: > Is there a more elegant means of checking an array for the presence > of a variable before adding it? - grep so far does not work for me. The answer to your question is in perlfaq4 under the section 'How can I tell whether an array contains a certain element?", basically the normal way is to convert your array to a hash. You should not use grep. You also not use @parsed[2] which should be $parsed[2], perlfaq4 explains the difference between the two, too. Best wishes, James -- James Ponder; Oaktree/IS4B Ltd., (024) 7663 3177; http://www.squish.net/