$hash->{$x}->{$y} = 1; # with autovivification ( $hash->{$x} ||= {} )->{$y} = 1; # without