in reply to Testing for one of three conditions

Three conditions may not be enough to warrant this, but it's also possible to construct the Perlish equivilant of a SWITCH statement. perlsyn goes into detail on loop and block control, which are the building blocks you use within Perl to hand-roll a switch construct. Or for the daring souls you can also use Switch; ...see Switch for details on that. Beware that Switch documentation states, "There are undoubtedly serious bugs lurking somewhere in code this funky." So in production code you're probably better off creating your own switch construct as described in perlsyn.

Sometimes logical short circuit operators or trinary operators can make the code more readable (and sometimes less, so use good judgement). They're discussed in perlop, though I see you're already using '&&' as a logical operator. Just remember that it can be used to control program flow too.

Update: Added quote from the Switch documentation as recommended by Enlil.


Dave