Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Complicated Hash Construction.

by pg (Canon)
on Dec 29, 2002 at 04:33 UTC ( #222849=note: print w/replies, xml ) Need Help??


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:
my $a = 1;
and this is not fine:
my $a[1];
This is also no good:
my @a; # this is okay my $a[1];# no good

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://222849]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2018-07-22 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (454 votes). Check out past polls.

    Notices?