Among the decent answers above, FoxtrotUniform makes a point that's worth expanding on a bit.

Someday in the future, someone (perhaps you) might pick up the code to extend it, and wonder at the logic. The conditional logic you've shown is simple, but conditional logic can get awkward. Leaving an empty else (or elsif) block is a way to signal to the future reader that you've considered that branch of the logic tree, and that there's nothing to do. If the logic is painfully simple, leaving a blank note isn't necessary, an intrudes on readability. But if the logic is messy, adding a short explanatory comment to the empty can save some future reader a lot of puzzling and pondering. It's a matter of finding the right balance.


In reply to Re: empty 'else' block by dws
in thread empty 'else' block by Anonymous Monk

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.