HP3000-L Archives

February 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Tue, 19 Feb 2002 14:13:29 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (37 lines)
See the question "How can I tell whether a list or array contains a certain
element?" in perlfaq4.
(i.e. type "perldoc perlfaq4" or view the equivalent web page)

----- Original Message -----
From: "Donna Garverick" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, February 19, 2002 1:51 PM
Subject: [HP3000-L] PERL: more questions :-)


> hi all!
>
> according to the latest perl documentation, it looks like
> the exists() function has been extended to arrays and this
> is good.  but if i'm reading the following correct, it's
> telling me the index/position/entry exists, not if the
> *value* exists in the array:
>
> print "Exists\n"    if exists $array[$index];
>
> is there a 'clever' way of searching an array to see if a
> given value is already stored?  i can always write up a loop
> thingy....but i thought i'd ask first....        - d
>
> --
> Donna Garverick     Sr. System Programmer
> 925-210-6631        [log in to unmask]
>
> >>>MY opinions, not Longs Drug Stores'<<<
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2