You cannot declare a hash as a slice like that. TIMTOWTDI but I would declare the hash first, then populate it:
my @players = qw/ barney fred dino/; my @bowling_scores = (195, 205, 30); my %score; @score { @players} = @bowling_scores; print "Tonight's players were @players\n"; print "Their scores were: @score{@players}";
In reply to Re: Working on hash slice
by hippo
in thread Working on hash slice
by catfish1116
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |