my @cis = $$range[1]-1 .. $$range[3]-1;
return [ map { sub{\@_}->(@{$$data[$_]}[@cis]) }
$$range[0]-1 .. $$range[2]-1 ]
####
my @column_indices = $col1 .. $colN;
return [
map {
sub{ \@_ }->( @{ $$data[$_] }[@column_indices] )
} $row1 .. $rowN
]
####
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;