@flat = map { @$_ } @{$aoa};
but is there a more efficient way to eliminate all the undefs right there inside the map() so I won't have to loop through the @flat array or invoke grep() to do it for me?
@flat = grep { defined } map { @$_ } @{$aoa};
I don't really know if this is even an issue, I'm just curious since practical uses of map() have always been a bit of a mystery for me.
In reply to Flatten sparse AoA by FloydATC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |