Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Simple one

by Taulmarill (Deacon)
on Aug 20, 2009 at 12:47 UTC ( #790082=note: print w/replies, xml ) Need Help??


in reply to Simple one

One difference is about context. The first line sets @_ in scalar context, which makes Arrays give back the number of their elements.

The second line sets the Array in list context, because $root now is in a list. The fact that the list has only one element does not concern @_. In list context, Arrays return all their elements. Since the list has only one element, only the first element of the array is stored.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2023-03-27 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?