in reply to Character class in an array

Another option over using $" is to inline the join in your regex.
my @a = ( 'a', 'x', 'z' ); my $match = qr/^[@{[ join '', @a ]}]{3}$/; while(<>) { print if /$match/; }
You can embed Perl inside any literal strings in this fashion.

Makeshifts last the longest.