in reply to prepend string to entire array
Since we need to access more than one array, it is more productive to iterate over the indices, not the elements themselves. ($#foo is the last index of @foo, by the way.)my @foo = ('A' .. 'G'); my @bar = (1 .. 7); my @baz; warn "arrays are not the same size!\n" unless @foo == @bar; for my $i (0..$#foo) { push @baz, $foo[$i] . $bar[$i]; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|