in reply to Conditional Elimination

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.