if ( --VALID STATE 1, 0000--) { # Do something here } elsif ( --VALID STATE 2, 1000--) { # Do something here } elsif ( -- And so on for your 5 valid states) { } else { # This is where your 11 INVALID states drop down. # Does it really matter *which* invalid state it is? }