in reply to What is the difference between a list and an array?
Consider this:
Furthermore, the distinction between a list and an array goes to context. There are two context's in perl, list, and scalar. The scalar function forces scalar context. The for (@something) "construct" implies list construct, as do functions and other things. To get a better grip on context in perl, please read japhys excellent article from perlmonth.com Issue 9: "List" is a Four-Letter Word (local) (remote).for my $thing("this","Is","aA","List") { print "$thing\n"; } print "\---------\n"; my @things = ("this","Is","aA","List","being","assigned","to","an","ar +ray"); for my $thing(@things) { print "$thing\n"; } print "\---------\n"; my %things = ("this", "Is", "aA", "List", "being", "assigned", "to", "a", "hash", "and", "as", "such", "it", "must", "be", "EVEN!", ,); for my $thing(@things) { print "$thing\n"; }
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re(2) (crazyinsomniac): What is the difference between a list and an array?
by dmmiller2k (Chaplain) on Dec 12, 2001 at 00:38 UTC | |
|
Re(2): (crazyinsomniac): What is the difference between a list and an array?
by dmmiller2k (Chaplain) on Dec 13, 2001 at 00:02 UTC |