in reply to Complicated Hash Construction.
You can declare an entity, but not a member of an entity. This is what the syntax error is about. In your bad case, you tried to declare my @hash{@keyarray}, which is an element of an entity.
It is NOT about the fact that you combined a declaration with an assignment.
This is fine:
It is NOT about the fact that you combined a declaration with an assignment.
This is fine:
and this is not fine:my $a = 1;
This is also no good:my $a[1];
my @a; # this is okay my $a[1];# no good
|
---|
In Section
Seekers of Perl Wisdom