Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How to check whether an element is present in an array of array

by kilinrax (Deacon)
on Jun 05, 2009 at 10:59 UTC ( [id://768750]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @arr1 = (1,2,3,4,5);
    my @arr2 = (6,7,8,9,10);
    my @arr3 = (11,12,13,14,15);
    my @mainarr = (\@arr1, \@arr2, \@arr3);
    
  2. or download this
    my @mainarr = ([1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]);
    
  3. or download this
    grep { $_ == $tofind } map { @$_ } @mainarray;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://768750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-19 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found