DEV Community

loading...

Discussion on: Way Too Many IF-THEN-ELSEs? Try a Lookup Table

Collapse
grinnz profile image
Dan Book • Edited

ReadonlyX is a great option for this. Note that exists and defined both still autovivify any intermediate structures - e.g. if you are looking at $foo->{bar}{baz} then $foo will be autovivified to {bar => {}} regardless of what the end check is (the final element will not be vivified unless assigned to). Two options for avoiding this are autovivification and my Data::DeepAccess.