Re: List checking
[email protected] (Ian Fitzgerald) Tue, 26 Sep 2000 08:00:28 +1100
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <8a36bf34a%[email protected]> |
In message <[email protected]> you wrote: > 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 Got it. Thankyou. -- Ian Fitzgerald - Melbourne Australia - Acorn RiscPC SA233 email: [email protected]