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

Re^2: Hash of arrays of hashes

by AnomalousMonk (Chancellor)
on Apr 14, 2013 at 20:24 UTC ( #1028645=note: print w/replies, xml ) Need Help??


in reply to Re: Hash of arrays of hashes
in thread Hash of arrays of hashes

next unless ref $current_port eq ""; # skip if $current port is NOT a +scalar.

Wouldn't this be better if more directly stated as
    next if ref $current_port;  # skip if $current port IS a reference
thus avoiding the double negative?

Replies are listed 'Best First'.
Re^3: Hash of arrays of hashes
by NetWallah (Abbot) on Apr 14, 2013 at 21:09 UTC
    Agreed that your code is shorter/better. Disagree that mine has a double-negative.

                 "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
            -- Dr. Cox, Scrubs

      Disagree that mine has a double-negative.

      Perhaps a matter of interpretation here. What I was thinking was that  unless can be re-written as  if not and  ref $current_port eq "" as  not ref $current_port yielding
          next if not not ref $current_port;

      Perhaps I should have written "implicit double negative". :)

        Perhaps I should have written "implicit double negative". :)

        unless is pronounced "unless" not "if not"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028645]
help
Chatterbox?
[LanX]: darn trying to downvote him again fails ... ;-P
[Discipulus]: congrats!
[LanX]: His Excelleny Choroba will now nbe clothed in his new robe ...
[Discipulus]: bishop ship sheeps in the shop..
[1nickt]: Discipulus too easy!
[1nickt]: "The sixth sheik's sixth sheep's sick" (if you are after 'sh' tongue twisters)
[Discipulus]: ok try it in Eatalian ;=)
[Eily]: Discipulus I don't suppose you can do the same for me can you ? :P
[Discipulus]: Eily tongue twister or votes? ;=)
[Eily]: Discipulus turn me into a Bishop

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2017-09-26 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (294 votes). Check out past polls.

    Notices?