Bah. Confusing, would sum it up IMO. DeMorgan's Law was never fun in circuits (why use NOR, and NAND gates, when they made AND and OR gates), which leads me back to Perl and why would one confuse oneself with something unnecessary when the same functionality can be gotten less confusingly?

Assuming I have things that have more than one condition, lets say colors = (Red blue green) and sizes (small medium and large) and luster (shiny dull). Now

unless ( size eq small and color eq red and luster eq dull ) { do_something} elsunless ( luster eq dull ) { do_something else} else {do_a_totally_different_thing)

So the unless does everything but small red dull things. the elsunless does whatever is left but dull things. So there would still be small dull red things for the else to deal with (I hope my logic is sound, as I mentioned above confusing). So from my understanding of my sequence of events it would be easier to just say:

if ( luster eq dull and color eq red and size eq small ) {do_a_totally_different_thing) elsif ( luster eq shiny ) { do_something_else } else { do_something }

I hope that my logic is not so flawed, as to have my point missed among my errors. And I would be happy to revise this if it is messed up.

Anyhow, now that I have thoroughly confused myself I will, shutup.

-enlil


In reply to Re: if/unless and chaining by Enlil
in thread if/unless and chaining by John M. Dlugosz

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.