Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How do I find the size of an array?

by mattr (Curate)
on Sep 03, 2005 at 15:36 UTC ( [id://488932]=note: print w/replies, xml ) Need Help??


in reply to How do I find the size of an array?

I never like to hear the words "size of" since it is not the sizeof that a C programmer will want.

Also I am embarassed to say that I do not know or maybe have forgotten when it is that scalar @array -1 != $#array. For example an array with a single element at index 5 will give the same results for both. Or are we talking about some kind of pruning?

That said I hate evaluating arrays as a scalar anyway since I expect something bad could happen (tm). Probably the important information I promptly forgot was distilled to this inchoate fear. Say it isn't so!

Originally posted as a Categorized Answer.

  • Comment on Re: How do I find the size of an array?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2025-06-20 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.