Consider having a large array @data
.
Additionally there is some array @indexes
that contains indexes to data (consider $indexes[n] < @data
to be guaranteed for each n).
Is there a simple expression to retrieve the result array
my @res;
foreach my $ind (@indexes){
push(@res, $data[$ind]);
}
e.g. (not working):
my @res = $data[@indexes];
is there something?