in reply to
How to flatten an x-dimensional array?
map
and
grep
are your friends.
sub flatten { map ref eq 'ARRAY' ? flatten(@$_) : $_, grep defined && length, @_ }
Cheers,
-Anomo
Comment on
Re: How to flatten an x-dimensional array?
Select
or
Download
Code
In Section
Seekers of Perl Wisdom