my @row_indices = $row1 .. $rowN; my @column_indices = $col1 .. $colN; my @row_subset; for my $row_idx (@row_indices) { my $row = $$data[$row_idx]; # deref $data and get row my $column_subset_aliases = sub{ \@_ }->( @$row[@column_indices] # deref $row and get array slice ); push @row_subset, $column_subset_aliases; } return \@row_subset;