You can't have map returning nested hashes assigned to a top-level hash, otherwise entries from different lines would collide (2 x Sidney, 2 x Canberra) my %hash = map { entry1 => { entry2 => 1} } <> # collisions of entry1