Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

( #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. 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 web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-02-07 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (249 votes), past polls