in reply to IN-style operator for set of possible values
This is almost exactly what you've asked for, but less typing:
if( $myfruit =~ m[bananas|apples|oranges] ){ print "I like $myfruit!"; } else { print "I don't like $myfruit!"; }
To be absolutely certain, you could use: m[^(?:bananas|apples|oranges)$]
|
|---|