<s>
In	O
the	O
Perl	B-Language
programming	I-Language
language	I-Language
,	O
autovivification	B-Language
is	O
the	O
automatic	O
creation	O
of	O
new	O
arrays	B-Data_Structure
and	O
hashes	B-Algorithm
as	O
required	O
every	O
time	O
an	O
undefined	O
value	O
is	O
dereferenced	O
.	O
</s>
<s>
Perl	B-Language
autovivification	B-Language
allows	O
a	O
programmer	O
to	O
refer	O
to	O
a	O
structured	O
variable	O
,	O
and	O
arbitrary	O
sub-elements	O
of	O
that	O
structured	O
variable	O
,	O
without	O
expressly	O
declaring	O
the	O
existence	O
of	O
the	O
variable	O
and	O
its	O
complete	O
structure	O
beforehand	O
.	O
</s>
<s>
Perl	B-Language
autovivification	B-Language
can	O
be	O
contrasted	O
against	O
languages	O
such	O
as	O
Python	B-Language
,	O
PHP	B-Application
,	O
Ruby	B-Language
,	O
and	O
many	O
of	O
the	O
C	O
style	O
languages	O
,	O
where	O
dereferencing	O
null	O
or	O
undefined	O
values	O
is	O
not	O
generally	O
permitted	O
.	O
</s>
<s>
It	O
can	O
be	O
compared	O
to	O
the	O
HTML	O
standard	O
's	O
"	O
named	O
access	O
on	O
the	O
window	O
object	O
"	O
which	O
results	O
in	O
corresponding	O
globally	O
scoped	O
variables	O
being	O
automatically	O
accessible	O
to	O
browser-based	O
JavaScript	B-Language
.	O
</s>
<s>
It	O
is	O
important	O
to	O
remember	O
that	O
autovivification	B-Language
happens	O
when	O
an	O
undefined	O
value	O
is	O
dereferenced	O
.	O
</s>
<s>
The	O
debugger	O
session	O
below	O
illustrates	O
autovivification	B-Language
of	O
a	O
hash	O
just	O
from	O
examining	O
it	O
:	O
</s>
<s>
The	O
debugger	O
session	O
below	O
illustrates	O
autovivification	B-Language
of	O
a	O
hash	O
from	O
assigning	O
to	O
an	O
inner	O
hash	O
:	O
</s>
<s>
Hashes	B-Algorithm
several	O
layers	O
deep	O
were	O
created	O
automatically	O
without	O
any	O
declarations	O
.	O
</s>
<s>
Autovivification	B-Language
can	O
prevent	O
excessive	O
typing	O
.	O
</s>
<s>
If	O
Perl	B-Language
did	O
not	O
support	O
autovivification	B-Language
,	O
the	O
structure	O
above	O
would	O
have	O
to	O
be	O
created	O
as	O
follows	O
:	O
</s>
<s>
Perl	B-Language
5.6.1	O
and	O
newer	O
support	O
autovivification	B-Language
of	O
file	O
and	O
directory	O
handles	O
.	O
</s>
<s>
The	O
C++	B-Language
Standard	I-Language
Library	I-Language
's	O
associative	O
containers	O
(	O
std::unordered_map	O
and	O
std::map	O
)	O
use	O
operator[]	O
to	O
get	O
the	O
value	O
associated	O
to	O
a	O
key	O
.	O
</s>
<s>
Python	B-Language
's	O
built-in	O
dict	O
class	O
can	O
be	O
subclassed	O
to	O
implement	O
autovivificious	O
dictionaries	O
simply	O
by	O
overriding	O
the	O
__missing__( )	O
method	O
that	O
was	O
added	O
to	O
the	O
class	O
in	O
Python	B-Language
v2.5	O
.	O
</s>
<s>
There	O
are	O
other	O
ways	O
of	O
implementing	O
the	O
behavior	O
,	O
but	O
the	O
following	O
is	O
one	O
of	O
the	O
simplest	O
and	O
instances	O
of	O
the	O
class	O
print	O
just	O
like	O
normal	O
Python	B-Language
dictionary	O
objects	O
.	O
</s>
<s>
Ruby	B-Language
hashes	B-Algorithm
can	O
take	O
a	O
block	O
specifying	O
an	O
object	O
to	O
be	O
returned	O
for	O
non-existing	O
indexes	O
.	O
</s>
<s>
PHP	B-Application
arrays	B-Data_Structure
are	O
natively	O
autovivificious	O
.	O
</s>
<s>
ES6	O
introduces	O
a	O
new	O
class	O
that	O
can	O
be	O
used	O
to	O
implement	O
autovivification	B-Language
.	O
</s>
<s>
With	O
other	O
features	O
of	O
JavaScript	B-Language
,	O
this	O
can	O
be	O
reduced	O
to	O
a	O
single	O
line	O
of	O
code	O
:	O
</s>
