We don't bite newbies here... much | |
PerlMonks |
Re(2) (crazyinsomniac): What is the difference between a list and an array?by dmmiller2k (Chaplain) |
on Dec 12, 2001 at 00:38 UTC ( [id://131039]=note: print w/replies, xml ) | Need Help?? |
A list is, well, just that, a list, a bunch of values separated by commas. You may be failing to address the confusion between what a list is with its literal representation in a program. After all a "bunch of values separated by commas" is considered a list literal, where the commas are mere notational conveniences. To the program itself, a list is a series of values, nevermind how they got there. This is NOT a flame! It goes more to highlighting the difference between what a thing is (e.g., list), and what you have to write in a program to get one. This particular distinction (or more precisely, the failure to understand it) caused more problems for me early on than maybe anything else (one exception: learning that my means local--in the C/C++ sense of the word--and that local really means localized global, or having a temporary local value for one But I digress). Fortunately for me, Perl's forgiving nature (combined with its uncanny "do what I mean" quality) saved my skin more than once. But when I later went back to examine some of my old code, I could see evidence of my then-incomplete understanding of these concepts. dmm You can give a man a fish and feed him for a day ...Or, you can teach him to fish and feed him for a lifetime
In Section
Meditations
|
|