title: Perl autovivification with TIEHASH
body: <p>This is the expected and intuitive behavior of a tied hash to handle <code>$h{a}++</code>:</p>
  
  <pre><code>$ perl -E'
      sub DESTROY {}
      sub AUTOLOAD { say "$AUTOLOAD @_"; bless {} }
      tie %h, main;
      $h{a}++;
  '
  main::TIEHASH main
  main::FETCH main=HASH(0x7fb6c982a188) a
  main::STORE main=HASH(0x7fb6c982a188) a 140423041558889
  </code></pre>
  
  <p>This is also expected to handle a nested case <code>$h{a}{b}++</code>, however I can't figure out why, nor, most importantly, how to override this behavior:</p>
  
  <pre><code>$ perl -E'
      sub DESTROY {}
      sub AUTOLOAD { say "$AUTOLOAD @_"; bless {} }
      tie %h, main;
      $h{a}{b}++;
  '
  main::TIEHASH main
  main::FETCH main=HASH(0x7fbff102a188) a
  </code></pre>
  
  <p>I've stumbled upon this while testing the <a href="http://cpan.me/Tie%3a%3aCHI" rel="nofollow">Tie::CHI</a>. It is clearly capable of storing complex objects:</p>
  
  <pre><code>$ perl -MDateTime -MTie::CHI -E'
      tie %c, "Tie::CHI", { driver =&gt; "File", root_dir =&gt; "." };
      $c{a} = DateTime-&gt;now;
  '
  </code></pre>
  
  <p>And Perl is capable of retrieving any data from the deeply nested structures, also:</p>
  
  <pre><code>print Dumper $c{json}-&gt;{results}[0]{geometry}{location};
  </code></pre>
  
  <p>But storing inside nested structures won't work in any tie()'d hash:</p>
  
  <pre><code>$c{json}-&gt;{results}[0]{geometry}{location} = [0, 0];
  </code></pre>
  
  <p>Could Tie::CHI be patched to handle this case with more DWIMmery? If not, what's the alternative?</p>