"be consistent" | |
PerlMonks |
Re: Newbie Array Questionby gothic_mallard (Pilgrim) |
on Oct 13, 2004 at 12:17 UTC ( [id://398834]=note: print w/replies, xml ) | Need Help?? |
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. All code is untested unless otherwise stated.
In Section
Seekers of Perl Wisdom
|
|