|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: How to flatten an x-dimensional array?by AidanLee (Chaplain) |
| on Mar 11, 2002 at 22:24 UTC ( [id://151039]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
consider a recursive solution:
update: I investigated per rob_au's concerns with the following code using the above subroutine:
and my output was this:
the example i gave explicitly passed an array_ref into the function to begin with, and @results is local to the subroutine, and does not get blown away during recursion.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||