my $node = @_;
$root is a scalar, so you evaluate @_ in scalar context, which yields the number of elements in @_, not its first element.
Here are a couple of ways of doing it:
my $node = shift; my $node = $_[0]; my ($node) = @_;
UPDATE: D'oh! I wrote my whole reply with $root whereas the problem is with $node. Fixed this.
--bwana147
In reply to Re: references and modules
by bwana147
in thread references and modules
by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |