perl binary search tree