C
Chris L.
Experienced Perl programmer-
I am running into an issue regarding three Foreach loops- one running
under another.
Specifically:
---------------------------------------------------------------------------------------------------------------------
foreach my $entri(@entry){
foreach my $imm(@imi){
foreach my $seq(@ses){
print "$entri $imm $seq\n";
}
}
}
------------------------------------------------------------------------------------------------------------------------
The outcome of this is the first entry in the @entry array, the first
entry in the @imi array, and then looping these first arrays results
over and over with the entire @ses array.
How can I iterate this so the first element of all three arrays are
printed. Then the second of all three arrays are printed. Then the
third, etc., etc.
I have tried using the next, last, redo and LABELS and cannot figure
this out.
Thank you for your expertise.
Chris
I am running into an issue regarding three Foreach loops- one running
under another.
Specifically:
---------------------------------------------------------------------------------------------------------------------
foreach my $entri(@entry){
foreach my $imm(@imi){
foreach my $seq(@ses){
print "$entri $imm $seq\n";
}
}
}
------------------------------------------------------------------------------------------------------------------------
The outcome of this is the first entry in the @entry array, the first
entry in the @imi array, and then looping these first arrays results
over and over with the entire @ses array.
How can I iterate this so the first element of all three arrays are
printed. Then the second of all three arrays are printed. Then the
third, etc., etc.
I have tried using the next, last, redo and LABELS and cannot figure
this out.
Thank you for your expertise.
Chris