Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Avoiding empty HASH ref. errors

by synapse0 (Pilgrim)
on Jul 16, 2001 at 10:32 UTC ( [id://96971]=note: print w/replies, xml ) Need Help??


in reply to Avoiding empty HASH ref. errors

Well, generally, using something like this would go <psuedo-code> my $thing = shift || default; </psuedo-code> which is pretty much what you are doing. So, i'd say it's a perfectly valid, reasonable, and readable method. You're not avoiding emptry hashref, you're setting a default (unless you really are avoiding an empty hashref, where the default shouldn't be an empty set, then yeah, there is probably a better way).
-Syn0

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 02:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found