To be honest, I think the better way to do it really is to not use those keywords (at least, not as statement modifiers), and not to keep the code compact. Whitespace is your friend. Especially after six months.

I don't know if you noticed it, but most of the people who have given analysis of your "complex conditional statement" (to use the term you used in the subject line) have added newlines and other whitespace just so they could wrap their heads around what was going on, and to help explain the logic that they were assuming you meant. This is a good indicator that your code, if you want it easy to read, decipher, and analyse later, should do similarly: add newlines and whitespace. Exactly the opposite of compact.

As long as you're spreading it out a bit, you probably should also use the if/unless keywords in their non-modifier form. This just makes things so much easier to understand. Remember - we're not writing code for the computer, but for the human reader. ;-)


In reply to Re^3: Complex conditional statements by Tanktalus
in thread Complex conditional statements by bofh_of_oz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.