Why does $foo->{bar} autovivify but %$foo doesn’t?
Note Code added to the question demostrates why autovivification doesn’t happen. Short Your sub takes a list (hash) which has an anonymous array as an element – and %$headers is buried in that array. It is the anon array that is the scalar aliased to, thus there is no requirement for %$headers to … Read more