- array of hashes
{
husband => "barney",
wife => "betty",
son => "bamm bamm",
},
…
)
push @AoH, { husband => "fred", wife => "wilma", daughter => "pebbles" };
$AoH[0]{husband} = "fred";
$AoH[1]{husband} =~ s/(\w)/\u$1/;
- array of arrays
[ "fred", "barney" ],
[ "george", "jane", "elroy" ],
[ "homer", "marge", "bart" ],
);
$AoA[2][3]
$ref_to_AoA->[2][3]
- hash of arrays
flintstones => [ "fred","barney" ],
…)
$HoA{teletubbies} = [ "tinky winky", "dipsy", "laa-laa", "po" ];
$HoA{flintstones}[0] = "Fred";
- hash of hashes
flintstones => {
husband => "fred",
pal => "barney",
},
...
)
$HoH{ mash } = {
captain => "pierce",
major => "burns",
corporal => "radar",
};
$role=$HoH{$family}{$role};
No comments:
Post a Comment