I have no problem with until or unless. I'm just conceding that using or (or and) for flow control is not as clear as it could be - and admitting that my own use of or (or and) for flow control is more out of laziness than anything else.

As for until or unless, I will use those when I would use them in prose describing what's going on. For simple conditions, readability and maintainability isn't hard and the of until or unless is, arguably, more natural1.

I'm thinking that complex conditions run into problems because the conditions are written in mathematical/logical notation (as they should be), so making the (implicit) surrounding not ( ... ) progressively more awkward to factor in.


1 some would argue that using until or unless is harder for new coders. Every day language of people I hear in places I visit as I go about my daily life has a lot of "until" and/or "unless" in it.

Side note: Pascal has both a while ... do begin ... end loop and a repeat ... until ... loop. Very different syntax for the 2 loop styles, but functionally the same as while and until in Perl (and some other languages).


In reply to Re^7: next unless condition by RonW
in thread next unless condition by hankcoder

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.