If you're ok with undef instead of the empty string for missing elements, you could use Algorithm::Loops's MapCharU.
use Algorithm::Loops qw( MapCharU ); my $bar = [ MapCharU { [ @_ ] } @$foo ];
The block could be changed to convert undefined values into empty strings, but it wouldn't be able to distinguish between undefined values in $foo and missing elements in $foo.
In reply to Re: rearranging an array of arrays
by ikegami
in thread rearranging an array of arrays
by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |