in reply to Use a Serialized Hash... When It Might Not Exist?
-1 is a true value. Use 0, "", or undef for false.
In fact, why not replace
if(DoIHaveThisData($hashref, 'key2')){
with
?if (exists $hashref->{key2}) {
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom