in reply to Comparing against multiple values

While that's very easy, it's not as fast as using a comparison operator such as 'eq'

If you're truly concerned about speed, use a /o modifier to compile the regex once, rather than re-interpolating the variable each time the regex is fired.

You'll also need to fix the regex to avoid false positives. Here's how I do it:

my $re = "\A(?:" . join("|", $foo, $bar, $baz) . ")\Z"; ... if ( /$re/o ) { ... }