Hi all, reading [AS]02 left me a bit unclear on list construction. Specifically, as comma still seems to be the list constructor, what do these produce:
my $a = (1, 2); # a List object of 1, 2?
my $a = (1); # Int 1?
my $a = (1,); # List of 1?
my ($a) = (1, 2); # Int 1? Or does it need *?
my ($a,) = (1, 2); # Same as above, I hope...
my ($a, $b) = (1); # $a == 1, I presume
Also what do these rather esoteric cases do:
my () = ();
my $a = ();
my ($a) = ();
Syntax errors in a few of those are welcome. :)
--
wolverian
signature.asc
Description: Digital signature
