I would go with something like this
#!/usr/bin/perl use strict; use warnings; use 5.14.0; my @a1 = qw (a b d e f g); my @a2 = qw (1 2 3 4 5 6 7); my $i = 0; my $count = $#a1 > $#a2 ? $#a1 : $#a2; for (0 .. $count) { no warnings 'uninitialized'; say "$_: $a1[$_] - $a2[$_]"; }
Cheers,
R.
In reply to Re: Parallel processing two arrays with different numbers of elements
by Random_Walk
in thread Parallel processing two arrays with different numbers of elements
by ww
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |