in reply to Looping through a hash reference is creating a key...?

Autovivification. Because you have to dereference $questions{4} to get to $questions{4}{foo}, the reference $questions{4} must be created.

Update: Note that if the not-already-existing reference is not dereferenced, but is just read, no autovivification goes on, so your code would work as you'd like if you did:

for (1 .. 4) { my $foo = $questions->{$_} && $questions->{$_}{foo} || "daklfjsdal +k"; }

The PerlMonk tr/// Advocate