in reply to Perly way of handling coordinates?

TIMTOWTDI (easy to follow, but not very Perl-ish); assumes a constant offset, but adapt as required:
my @origin = (2, 3, 22, 17); my @offset = (4,5); my $n = 0; my $p = 0; for my $origin(@origin) { push(my @interesting_cell, $origin[$n] + $offset[$p]); $n++; $p++; if ( $p > 1 ) { $p = 0 }; for my $interesting(@interesting_cell) { print "$interesting \n"; } }
prints:
6
8
26
22

Afterthought: OP clearly doesn't want the output formatted this way, but can use the values as desired.