Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: How to eliminate warning message on hash value?

by Marshall (Canon)
on Dec 20, 2011 at 05:23 UTC ( [id://944335]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to eliminate warning message on hash value?
in thread How to eliminate warning message on hash value?

I updated the post. I didn't notice the line length issue before. Lines on PM are shorter than I normally use, but this is solved easily as shown. Very complicated conditions can be made readable in this "vertical" manner.

Update: As a historical note, I learned this method from Daniel McCraken when I was working with FORTRAN IV some years ago.

  • Comment on Re^4: How to eliminate warning message on hash value?

Replies are listed 'Best First'.
Re^5: How to eliminate warning message on hash value?
by ikegami (Patriarch) on Dec 20, 2011 at 06:04 UTC
    I didn't say it couldn't be done, I said "if" worked better. (No artificial code placement, nested instead of zizag indenting.)
      Well, I wrote this code today and I think it illustrates this style better...

      Of course what these variables mean is completely out of context, but I can't imagine the horror of this expressed as nested "if's". Call it "zigzag indenting" or whatever.

      For more complex "if" statements, I do think this has a certain regularity that is pleasing to the eye. Mileage varies.

      print if ( exists ($noBye4Call{$rCall} ) and ($rNr > 10 ) and ($GP{STATUS} eq 'G' ) and ($GP{SCORE} eq 'BYE') );
        [ Sorry, didn't see this reply earlier ]

        For more complex "if" statement

        Yes, different styles work better in different circumstances.

        I do think this has a certain regularity that is pleasing to the eye

        Really, then why did you switch style in your example? You stop aligning your conditions, removed the zigzaging, and added a gazillion parens.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found