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

Re: Newbie Array Question

by gothic_mallard (Pilgrim)
on Oct 13, 2004 at 12:17 UTC ( [id://398834]=note: print w/replies, xml ) Need Help??


in reply to Newbie Array Question

As previously mentioned, CGI (or possibly CGI Lite) may be the way to go.

You are getting confused between arrays and hashes. In some languages (such as Javascript) you can indeed reference elements by named indexes as in your example. So for a quick array vs hash overview.

In perl, an array is really an ordered list. The elements are indexed by the order in which they appear in the array and, unless there is specific intervention, this order remains. As with other languages, the array indexing begins with 0.

A hash on the other hand is a set of unordered key-value pairs where both the key is a scalar (numeric or alphanumeric) and the value may be of any type (scalar, array, hash, glob etc).

Check out the Q&A section for a wealth of information on arrays, hashes and CGI programming.

--- Jay

All code is untested unless otherwise stated.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found