Oh, that's annoying. In fairness, a documented feature of mine is that it explicitly avoids autovivifying keys. So with Tie::Hash::Vivify, this is true:
tie my %hash, 'Tie::Hash::Vivify', sub { 10 };
say $hash{foo}; # says 10
my $is_this_true = exists $hash{foo};
Whereas this is false:
tie my %hash, 'Hash::DefaultValue', sub { 10 };
say $hash{foo};
my $is_this_true = exists $hash{foo};
Another feature of Hash::DefaultValue is that the coderef gets passed a copy of the key, so can use that information when generating the default value.
tie my %hash, 'Hash::DefaultValue', sub { uc };
say $hash{foo}; # says "FOO"
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
|