Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Simple array question

by davido (Cardinal)
on Dec 22, 2003 at 17:21 UTC ( [id://316421]=note: print w/replies, xml ) Need Help??


in reply to Simple array question

Evaluating an array in scalar context will tell you how many elements the array contains. length is not the right tool for the job.

my @array = (["customer", "20528"], ["priority", "3"]); print scalar @array;

It's an easy (and common) mistake to make.


Dave

Log In?
Username:
Password:

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

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

    No recent polls found