#!/usr/bin/perl
#
# Autovivification example (which means bringing to life automagically)
#
use strict;
use warnings;
use Data::Dumper;
 
my $h = {};
 
print Dumper($h); # {}
 
exists $h->{foo}->{baz};
 
#
# Foo has been added automatically
#
print Dumper($h); # { foo => {} }
 
Powered by GeSHi