Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by jeffa (Bishop)
on Jan 13, 2009 at 17:55 UTC ( #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
Node Status?
node history
Node Type: note [id://736022]
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 2020-12-03 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (49 votes). Check out past polls.

    Notices?