in reply to Parallel processing two arrays with different numbers of elements

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.

Pereant, qui ante nos nostra dixerunt!
  • Comment on Re: Parallel processing two arrays with different numbers of elements
  • Download Code