Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: Like in hashes, do we have something like exists in arrays as well.

by Rahul6990 (Beadle)
on Jan 24, 2013 at 07:15 UTC ( #1015094=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > Like in hashes, do we have something like exists in arrays as well. - Answer contributed by Rahul6990

This will work for you:
print "$element in @array1\n" if(grep( /$element/, @array1 )) ;

  • Comment on Answer: Like in hashes, do we have something like exists in arrays as well.
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the questions are moot...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2018-02-18 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (250 votes). Check out past polls.

    Notices?