in reply to Perly way of handling coordinates?
prints: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"; } }
6
8
26
22
Afterthought: OP clearly doesn't want the output formatted this way, but can use the values as desired.
|
|---|