in reply to Change elements order in an array
my @new_order = (2, 1, 0);
BTW, that's where the undef's were coming from.
Update: to change the order of the inner arrays, you have to slice the inner arrays:
my @new_aoa = map [ @$_[@new_order] ], @AoA;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Change elements order in an array
by Anonymous Monk on Oct 16, 2015 at 15:13 UTC | |
by stevieb (Canon) on Oct 16, 2015 at 15:24 UTC |