Created
January 18, 2015 22:19
-
-
Save pwr22/c63c0e3f3309d0c95344 to your computer and use it in GitHub Desktop.
Hash of Arrays of Hashes in Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a hash | |
my %hashOfArraysOfHashs = ( key1 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }], | |
key2 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }]); | |
# This is a hashref | |
my $hashOfArraysOfHashs = { key1 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }], | |
key2 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }]}; | |
# These also a hashref | |
my $href = \%{$hashOfArraysOfHashs} | |
my $href2 = {%hashOfArrayOfHashs} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment