A list is, well, just that, a list, a bunch of values separated by commas. An array is a data structure -- a "variable".
Consider this:
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";
}
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).
___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;"