Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: references and modules

by bwana147 (Pilgrim)
on Jul 23, 2001 at 13:13 UTC ( [id://98941]=note: print w/replies, xml ) Need Help??


in reply to references and modules

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://98941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found