Why are some hashes initialized using curly braces, and some with parentheses?

Viewed 7326

I'm looking at the following code demonstrating nested hashes:

my %HoH = (
    flintstones => {
        husband   => "fred",
        pal       => "barney",
    },
    jetsons => {
        husband   => "george",
        wife      => "jane",
        "his boy" => "elroy",  # Key quotes needed.
    },
    simpsons => {
        husband   => "homer",
        wife      => "marge",
        kid       => "bart",
    },
);

Why is it that the upper-most hash (starting line 1) is initialized using parentheses, whereas the sub-hashes are initialized using curly braces?

Coming from a python background I must say Perl is quite odd :).

3 Answers
Related