in reply to Re: autovivication gonna make me lose my mind
in thread autovivication gonna make me lose my mind

I think autovivification can happen in contexts other than dereferencing an element as an lvalue. Consider the following script.

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $hashref; print "exists\n" if(exists($hashref->{foo}->{bar})); print Dumper($hashref);

It prints

$VAR1 = { 'foo' => {} };

So, unless the argument to exists is dereferenced as an lvalue (I don't know how it is implemented) there are other contexts.

Explaining Autovivication, Accidentally creating hash elements with grep { defined } on a hash slice and The Bad, the Ugly, and the Good of autovivification have more info.