in reply to Compare and merge array elements help!

my %lkup = map { $_->[0] => $_ } @$ar_ref_2; for (@$ar_ref_1) { my $key = $_->[1]; if (my $extra = $lkup{$key}) { push @$_, @$extra[ 1..$#$extra ]; } else { warn("Bad join for $key\n"); push @$_, (undef)x11; } }

Replies are listed 'Best First'.
Re^2: Compare and merge array elements help!
by Anonymous Monk on May 07, 2009 at 16:25 UTC
    Hi, can't get your code to work with this, here is what I am getting:
    Global symbol "$extra" requires explicit package... Global symbol "$extra" requires explicit package... syntax error near "}" syntax error near "}" Execution aborted due to compilation errors.
      There was a missing ")". Fixed.
        I was looking for something like this, good work!