more useful options | |
PerlMonks |
Re: Printing from three arraysby FreeBeerReekingMonk (Deacon) |
on Sep 26, 2019 at 21:06 UTC ( [id://11106768]=note: print w/replies, xml ) | Need Help?? |
edit:Deleted code that was identical to Discipulus's code. You want to loop over the array index, you need to enumerate from 0 to the array length minus 1, which is that "$#". The initialization (my $i = $j = $k = 0;) is not required because you already use the "my" in each loop. A more C stylish approach (not necessarily better):
Note that because in each iteration it needs to calculate $# these loops are slower than iterating over the values of each array, as already shown by other monks.
In Section
Seekers of Perl Wisdom
|
|