in reply to Re^2: Adding an element of an array as a key for a Hash, and remaining elements as its value (would also be a hash)
in thread Adding an element of an array as a key for a Hash, and remaining elements as its value (would also be a hash)
... something that I have to learn about these braces
$MasterHash{$mvr} = { map { split /:/; } @array1 };
^ ^ ^ ^
| | | |
| + sub block + |
| |
+ anon hash ref constructor +
See perlref for anonymous reference constructors (in particular, Making References section 3 for the anon hash ref constructor) and also perlreftut. See map for the function of the sub(routine) block.
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Adding an element of an array as a key for a Hash, and remaining elements as its value (would also be a hash)
by abhiram10 (Initiate) on Apr 12, 2016 at 03:21 UTC |