Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thank you!#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @new_order = (0, 1, 2, 3, 5, 4); my @AoA = ( [ "aaa", "bbb", "ccc", "ddd", "fff", "eee", ], [ "111", "222", "333", "444", "666", "555", ], [ "ppp", "eee", "rrr", "lll", "kkk", "ooo", ], ); my @new_aoa = @AoA[@new_order]; print Dumper \@new_aoa; print "\n\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Change elements order in an array
by choroba (Cardinal) on Oct 16, 2015 at 15:04 UTC | |
by Anonymous Monk on Oct 16, 2015 at 15:13 UTC | |
by stevieb (Canon) on Oct 16, 2015 at 15:24 UTC | |
|
Re: Change elements order in an array
by stevieb (Canon) on Oct 16, 2015 at 15:13 UTC | |
by Anonymous Monk on Oct 16, 2015 at 15:25 UTC |