in reply to Sort by distance
(copy ikegami) and: I imagine you want my not local. You rarely, if ever, want local. You also seem to be missing a closing brace.
I was trying to reformulate this as a Schwartzian transform, but I'm confused about what it is that you're sorting. I'd expect something like this to work, but it wont if you're comparing the distance between $a and $b -- what would the usefulness of that be?
my @sorted_points = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map {[$_, dist($_, $reference_point)]} @points; # points is an AoA structure
-Paul
|
|---|