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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combination help script

Status
Not open for further replies.

PerlElvir

Technical User
Aug 23, 2005
68

Hi all,
can someone help me to make this script with combination, because Im begginer :eek:). I have :

a1
a2
a3

and

b1
b2
b3

so I need script which will make all combination:

a1:b1,a1:b2,a1:b3,a2:b1,a2:b2...
 
my @arr1 = (a1,a2,a3);
my @arr2 = (b1,b2,b3);

foreach my $var1 (0 .. $#arr1) {
foreach my $var2 (0 .. $#arr2) {
print "$arr1[$var1], $arr2[$var2]\n";
}
}



Corwin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top