This morning while trying to answer an SOPW I wanted to give a citatation explaining how to use if...elsif...else. Naturally, I thought of perlsyn, but when I looked there all I could find was the somewhat cryptic if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK. There was no discussion or comment. (For a direct link to this,see the "here" in BrowserUk's post below).

The only way I found even that was my handy-dandy firefox search button. Conditionals have no section of their own.

It is common in discussions of computer language syntax to have a whole section on conditions. perlsyn has one on loops, but not on conditionals. There doesn't seem to be a separate perldoc on conditionals and the conditional section in perlop only covers  expr ? expr : expr syntax.

Is there a reason for this? Is this an oversight? An oversight seems unlikely given the maturity of this documentation and the importance of the syntax. Another place to look?

Thanks in advance, beth

Update: there appears to be a brief example of "if...elsif..else" in perlintro - see post by Anonymous below.


In reply to Where is if...elsif...else documented in perldoc? by ELISHEVA

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.