in reply to var comparison
( grep { $var eq $_ } qw( foo bar ) ), but I would probably stick to your first example. This is close to the point where I would refactor out the comparison into a sub named with a description of what I was trying to check.
--MidLifeXis
In Section
Seekers of Perl Wisdom