R
Rose
Is it possible for me to use "foreach" to make the following codes in a
better way? I don't want to create subroutine and call. Because I can't use
@%arr this time (%arr1 not equal to %arr[1]). Copying the %arr1, %arr2, ...,
%arrn into a single large array is impractical, because %arr1, ...n is
already very large each.
while (($loc, $sub) = each(%arr1)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}
while (($loc, $sub) = each(%arr2)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}
....
while (($loc, $sub) = each(%arrn)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}
better way? I don't want to create subroutine and call. Because I can't use
@%arr this time (%arr1 not equal to %arr[1]). Copying the %arr1, %arr2, ...,
%arrn into a single large array is impractical, because %arr1, ...n is
already very large each.
while (($loc, $sub) = each(%arr1)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}
while (($loc, $sub) = each(%arr2)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}
....
while (($loc, $sub) = each(%arrn)) {
print "$loc\tSub\t$sub\t$notes[0]\t$start\t$end\n";
}