Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for one element in an array 1

Status
Not open for further replies.

rubis

Programmer
Jun 21, 2001
54
GB
Hi all,

Is there any function/a method to check if a particular value is in an array apart from using "foreach" to check it one by one??

Thanks,
 
print "FOUND IT!" if( grep(/pattern/, @list) )
The grep function is one way to do it.

--jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top