What\'s the easiest way to flatten a multidimensional array ?
Something along the lines of:
my $i = 0; while ($i < scalar(@array)) { if (ref @array[$i] eq 'ARRAY') { splice @array, $i, 1, @$array[$i]; } else { $i++; } }
I wrote it blindly, no idea if it actually works but you should get the idea.