Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Difference between array and a hash? (Newbie concerns)

by merlyn (Sage)
on Jul 30, 2009 at 01:59 UTC ( [id://784450]=note: print w/replies, xml ) Need Help??


in reply to Difference between array and a hash? (Newbie concerns)

An array is a list of ordered items, useful when the ordering is important (usually).

A hash is a set of key/value pairs of unordered items, useful when you want to quickly get from a key to its corresponding value no matter how large the data set might get.

Or, in short: hashes are for mapping, arrays are for ordering.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

  • Comment on Re: Difference between array and a hash? (Newbie concerns)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-23 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found