Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Compare two arrays

by Marklitz (Initiate)
on Apr 02, 2009 at 10:32 UTC ( [id://754906]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    array1 = {this1 this2 this11 this21 this23};
    array2 = {h2this1 h3this2 h5this21 h6this23 h8this13}
    
  2. or download this
    for $i(0.. $#array1){
     for $j(0.. $#array2){
    ...
        print"$array1[$j] belongs to $array2[$i]";
       last;
    }}}
    
  3. or download this
    this1 belongs to h2this1 
    this2 belongs to h3this2 
    this2 belongs to h5this21 
    this2 belongs to h6this23 
    this1 belongs to h8this13
    
  4. or download this
    this1 belongs to h2this1 
    this2 belongs to h3this2 
    this21 belongs to h5this21 
    this23 belongs to h6this23 
    this1 belongs to h8this13
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-19 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found