Regexes are just strings (well, at least you can think of them that way), which means you can build
them up just as you would any other strings.
my $regex = join '|', @all_the_different_values;
if ( $data =~ /$regex/ ) . . .
If you need only exact matches, then you should probably write it as
if ( $data =~ /^($regex)$/ ) . . .
On the other hand, unless you're using the power of regexes to do something like "wildcard" matching,
there's another way to do it you should consider: Make a "set" of the values, and test for the
existence of
$data in that set.
my %set;
@set{ @all_the_different_values } = (); # make the set
if ( exists $set{ $data } ) . . .
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.