my $nmax = (@$out > @$result) ? @$out : @$result;
for (my $n=0; $n < $nmax; $n++) {
if (!defined($out->[$n]) || !defined($result->[$n]) ||
my $nmax = (@$out > @$result) ? @$out : @$result;
for (my $n=0; $n < $nmax; $n++) {
if (!defined($out->[$n]) || !defined($result->[$n]) ||