in reply to Trouble traversing binary tree (was: recursion)

$head = shift;
should be
my $head = shift;
which use strict would have caught, likely.

-- Randal L. Schwartz, Perl hacker