Port binary search tree to perl5