in reply to Autovivify Module?
So, is there a module out there that will control the way perl autovivifies
No. If you want to prevent autovivification, you have to code appropriately:
undef $ref; if ("HASH" eq ref $ref && exists $ref -> {"Some key"}) { }
If you can't assume that $ref is a reference to a hash, you'd need extra testing anyway, even if there wasn't autovivification. For instance:
$ref = []; if (exists $ref -> {key}) { }
will give you a Can't coerce array into hash error.
Abigail
|
|---|