@{ $arr_1[$i][@indices] } should be @{$arr_1[$i]}[@indices] if you want to return a slice with the element order determined by @indices. Although you don't reference the line where the error is being reported nor give us enough code to actually reproduce your error, that is most likely where the issue is.
Aside from that, your final loop uses $e as a loop variable, but @arr_1 is indexed by the undeclared variable $i. Always use strictures (use strict; use warnings; - see The strictures, according to Seuss)!
Using Perl there are very few places where you need to resort to using a C for loop. Use a Perl for loop instead:
for my $i (0 .. $#suff) {...}
although the last loop in your sample code might be better written:
for my $elt (@arr_1) { @$elt = @{$elt}[@indices]; }
or even
@$_ = @{$_}[@indices] for @arr_1;
In reply to Re: Sorting multidimensional arrays using a list of indices
by GrandFather
in thread Sorting multidimensional arrays using a list of indices
by eas2domine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |