- or download this
use strict;
use warnings;
...
@newList = @list[@newOrder];
print qq{@newList\n};
- or download this
zero one two three four
three zero four one two
one three four zero two
- or download this
This code
...
$newList[2] receives $list[4] which is 'four'
$newList[3] receives $list[0] which is 'zero'
$newList[4] receives $list[2] which is 'two'