loris has asked for the wisdom of the Perl Monks concerning the following question:
Dear all,
I am working with 2D coordinates (actually representing cells in an Excel sheet) and need to add and subtract various offsets to get at the coordinates I need. Currently I am mainly using references to arrays to hold the coordinates, but I was wondering whether there was some clever perly way via which I would be able to do something like the obviously incorrect:
@origin = (2,3); @offset = (4,5); @interesting_cell = @origin + @offset; # = (4) not (6,8) Doh!
Any ideas?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perly way of handling coordinates?
by moritz (Cardinal) on Sep 12, 2007 at 07:33 UTC | |
|
Re: Perly way of handling coordinates?
by moklevat (Priest) on Sep 12, 2007 at 16:14 UTC | |
|
Re: Perly way of handling coordinates?
by jettero (Monsignor) on Sep 12, 2007 at 10:48 UTC | |
|
Re: Perly way of handling coordinates?
by jbert (Priest) on Sep 12, 2007 at 07:59 UTC | |
|
Re: Perly way of handling coordinates?
by artist (Parson) on Sep 12, 2007 at 15:40 UTC | |
|
Re: Perly way of handling coordinates? (*max+)
by tye (Sage) on Sep 12, 2007 at 15:25 UTC | |
|
Re: Perly way of handling coordinates?
by ww (Archbishop) on Sep 12, 2007 at 14:20 UTC | |
|
Re: Perly way of handling coordinates?
by spectre9 (Beadle) on Sep 13, 2007 at 01:26 UTC |