Except for formatting of the first example, I'd leave it as is. I'd format the first one as:
if ($a eq "A" && $b eq "C" && $p != 1 && $s ne "P") { return "12341"; }
There may be all kinds of ways to condense the clauses, but while that may save on the number of lines, just listing them is probably the simplest, and easiest to understand.

The latter example could be written as

if ($a eq "A" && $p >= 88 && $p <= 91) { return $p; }
but I'd only write that if it's really intended that $p is inside a range (and an integer), instead of one of 4 values that just happened to be in a row.

In reply to Re: Conditional Elimination by JavaFan
in thread Conditional Elimination by dunnyman

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.