if (exists $hash{'A1'}{'B2'}{'C1'}) { push ( @{ $hash{'A1'}{'B2'}{'C1'}}, arrayitem4; } else { $hash{'A1'}{'B2'} = {'C1' => [arrayitem1]}; }