in reply to Re^4: Array_ref into Array_ref Help.
in thread Array_ref into Array_ref Help.

I wouldn't be too upset if you tried out this one on your own...

Replies are listed 'Best First'.
Re^6: Array_ref into Array_ref Help.
by Anonymous Monk on Apr 22, 2009 at 19:44 UTC
    That's right, but the reason to ask is that what and where would be the more logical place to check for inconsistency, check first if the element is empty or undef and where to assign a empty value so when displaying the report it would show a blank space on the report.
      In the interest of not learning...
      my $max = $#$ref_a > $#$ref_b ? $#$ref_a : $#$ref_b; my @blank_a = ("") x @$ref_a; my @blank_b = ("") x @$ref_b; my @result = map { [ $ref_a->[$_] ? @{$ref_a->[$_]} : @blank_a, $ref_b->[$_] ? @{$ref_b->[$_]} : @blank_b ] } 0..$max;
      By the way, anyone have a prettier way to do this?