P is for Practical | |
PerlMonks |
Re: Avoiding empty HASH ref. errorsby synapse0 (Pilgrim) |
on Jul 16, 2001 at 10:32 UTC ( [id://96971]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|