Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Use a Serialized Hash... When It Might Not Exist?

by choroba (Cardinal)
on Nov 11, 2022 at 23:01 UTC ( #11148150=note: print w/replies, xml ) Need Help??


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]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2023-02-03 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (25 votes). Check out past polls.

    Notices?