in reply to Re: searching nested structures
in thread searching nested structures
add on top of what sporty quoted, exists() is just one case for autovivification. To be precise on autovivification: any attempt to read or test an element that does not exist, will create its ancestors.
use Data::Dumper; use strict; use warnings; my $data = {"a" => 1}; $data->{"b"}->{"b"}->{"b"}->{"b"};#useless use of hash element in void + context? interesting error message. The useless use is actually not +that useless. print Dumper($data);
this prints:
$VAR1 = { 'a' => 1, 'b' => { 'b' => { 'b' => {} } } };
|
|---|