Combinations of strings in perl
i am new to perl environment....i have n number of arrays with n number of strings in it and iam trying to get the combinations of all the strings of all the arrays ie i have like.....
array1="array1_String_1,array1_String_2,array1_String_3 ..... array1_String_n"; array2="array2_String_1,array2_开发者_StackOverflowString_2,array2_String_3 ..... array2_String_n"; array3="array3_String_1,array3_String_2,array3_String_3 ..... array3_String_n";
.
.
.
.
arrayn="arrayn_String_1,arrayn_String_2,arrayn_String_3 ..... arrayn_String_n;
example suppose if i take " array1_String_1 " it has to get the combinations from array2,array3.....arrayn but not from array1.
Similarly "array2_String_1" has to get combinations from all the arrays except array2 likewise it has to cover all the combinations of strings except the array which that string is stored. Like that i need to get combinations of all the strings in an array with other other arrays.
It should not go for combinations of the strings that are in the same array.ie array1 elements has to get combinations from array2,array3.... arrayn but not from array1
How can i get the combinations of all the strings of all the arrays in perl.... please help me... Please
Check out the Math::Combinatorics and Algorithm::Combinatorics modules.
I use my Set::CrossProduct module to do this sort of thing.
精彩评论