Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing reference to subroutine

by aukjan (Friar)
on Oct 03, 2008 at 06:33 UTC ( [id://715148]=note: print w/replies, xml ) Need Help??


in reply to Passing reference to subroutine

Actually $#var gives you the subscript of the last item in the list, the scalar value of @var gives you the number of elements in the list. So if you want the number of elements in a list reference, you can get it by:
my $size = scalar @$var;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 18:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found