Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Is this "next unless $keys" necessary?

by jeffa (Bishop)
on Jan 13, 2009 at 17:55 UTC ( [id://736022]=note: print w/replies, xml ) Need Help??


in reply to Is this "next unless $keys" necessary?

The situations where this would be needed are pretty contrived, IMHO. That would mean that someone is using hash keys of value zero or the empty string -- which is certainly allowable, but very contrived:

my %hash = ( foo => 'bar', 0 => 'baz', '' => 'qux', ); for (sort keys %hash) { next unless $_; print "$_ => $hash{$_}"; } for (sort keys %hash) { print "$_ => $hash{$_}"; }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found