in reply to Re (tilly) 2: How to flatten an x-dimensional array?
in thread How to flatten an x-dimensional array?
needs to bepush @_, @$last;
since you are reversing the result. Trivial example: $last = [1,2,3,4,5] must flatten as 5, 4, 3, 2, 1 so it can be reversed in the final result to 1, 2, 3, 4, 5 again.push @_, reverse @$last;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 4: How to flatten an x-dimensional array?
by tilly (Archbishop) on Mar 12, 2002 at 20:59 UTC |