kd-Trees in Perl