in reply to rearranging an array of arrays

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.