<?xml version="1.0" encoding="windows-1252"?>
<node id="998414" title="Re^4: Occurence List" created="2012-10-11 06:44:19" updated="2012-10-11 06:44:19">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;i&gt; will cause perl to complain (if you have not declared (and thus created) $foo before),
while writing &lt;/i&gt;
&lt;p&gt; Oh will it now?
&lt;c&gt;
$ perl -le " use warnings; use strict; my $foo; $foo++; print $foo "
1

&lt;/c&gt;
&lt;p&gt; &lt;i&gt;  So these two examples are not comparable. And I believe the second example actually is where we see autovivication at work.&lt;/i&gt;
&lt;p&gt; Yes, they really are exactly comparable, and no, the second example is not autovivification any more than the first example is autovivification  -- neither is autovivification
&lt;p&gt; Growing an array is not autovivification. JavaScript doesn't support autovivification , try it if you have firefox ( Ctrl+Shift+K )
&lt;c&gt;
[03:41:08.755] var noauto = [ 0, 1 ]; noauto[ 6 ] = 66; noauto ;
[03:41:08.764] [0, 1, , , , , 66]
[03:43:06.834] noauto[2].failToAutoVivify = 12; noauto;
[03:43:06.843] TypeError: noauto[2] is undefined
&lt;/c&gt;
&lt;p&gt; JavaScript supports growing arrays but not autovivification, but perl does supports it, undef becomes a hashref if you treat it like a hashref &lt;c&gt;$ perl -MData::Dump -le " my $auto = [ 0, 1 ]; $$auto[6]=66; dd $auto; "
[0, 1, undef, undef, undef, undef, 66]


$ perl -MData::Dump -wle " my $auto = [ 0, 1 ]; $$auto[6]=66; $$auto[2]{VIVIFY}=12; dd $auto; "
[0, 1, { VIVIFY =&gt; 12 }, undef, undef, undef, 66]
&lt;/c&gt;</field>
<field name="root_node">
998273</field>
<field name="parent_node">
998409</field>
<field name="reputation">
0</field>
</data>
</node>
