davidfilmer has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, Masters. This hash slice works exactly as expected:
my %fruit; $fruit{'apple'} = 'red'; @fruit{'lemon', 'lime'} = ( 'yellow', 'green' ); print Dumper \%fruit;
This, however, throws a syntax error on the slice, even though the syntax is comparable:
my %auto; $auto{'ford'}{'F150'}{'color'} = 'RED'; @auto{'ford'}{'F150'}{'tires','lights'} = ('ALL SEASON','HALOGEN'); print Dumper \%auto;
What is the proper syntax for a slice of a multi-level hash? This is perl v5.12.1, FWIW.

With gratitude for your 'perls' of wisdom.

Replies are listed 'Best First'.
Re: Slice of a multi-level hash
by LanX (Saint) on Oct 16, 2014 at 23:35 UTC