Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How to find number of elements of an array from array reference

by moritz (Cardinal)
on Apr 07, 2011 at 14:41 UTC ( [id://898079]=note: print w/replies, xml ) Need Help??


in reply to How to find number of elements of an array from array reference

length is for getting string lengths. To get the number of elements, simply use the array in scalar context:

my $elems = @$array_ref;
  • Comment on Re: How to find number of elements of an array from array reference
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found