1.ARRAYS OF ARRAYS
@AoA = (
[ “fred”, “barney” ],
[ “george”, “jane”, “elroy” ],
[ “homer”, “marge”, “bart” ],
);$ref_AoA = [
[ “fred”, “barney” ],
[ “george”, “jane”, “elroy” ],
[ “homer”, “marge”, “bart” ],
];$AoA[1][1] = “george”;
$ref_AoA->[1][1] = “george”;
2.HASHES OF ARRAYS
%HoA = (
carmans => [ “fred”, “barney” ],
jetsons => [ “george”, “jane”, “elroy” ],
simpsons => [ “homer”, “marge”, “bart” ],
);$ref_HoA = {
carmans => [ “fred”, “barney” ],
jetsons => [ “george”, “jane”, “elroy” ],
simpsons => [ “homer”, “marge”, “bart” ],
};$HoA{jetsons}[1] = “george”;
$ref_HoA->{jetsons}[1] = “george”;
3.ARRAYS OF HASHES
@AoH = (
{
Lead => “fred”,
Pal => “barney”,
},
{
Lead => “george”,
Wife => “jane”,
Son => “elroy”,
},
{
Lead => “homer”,
Wife => “marge”,
Son => “bart”,
}
);$ref_AoH = [
{
Lead => “fred”,
Pal => “barney”,
},
{
Lead => “george”,
Wife => “jane”,
Son => “elroy”,
},
{
Lead => “homer”,
Wife => “marge”,
Son => “bart”,
}
];$AoH[1]{Lead} = “george”;
$ref_AoH->[1]{Lead} = “george”;
4.HASHES OF HASHES
%HoH = (
carmans => {
Lead => “fred”,
Pal => “barney”,
},
jetsons => {
Lead => “george”,
Wife => “jane”,
Son => “elroy”,
},
simpsons => {
Lead => “homer”,
Wife => “marge”,
Son => “bart”,
},
);$ref_HoH = {
carmans => {
Lead => “fred”,
Pal => “barney”,
},
jetsons => {
Lead => “george”,
Wife => “jane”,
Son => “elroy”,
},
simpsons => {
Lead => “homer”,
Wife => “marge”,
Son => “bart”,
},
};$HoH{jetsons}{Lead} = “george”;
$ref_HoH->{jetsons}{Lead} = “george”;
留言