Help for this page
my $valid = join "|", @valid; print "okay" if /^$valid$/;
# don't run this code on every match: the idea is the qr// needs # to be computed only once. ... # now match as many times as you like. print "$_: " . (/$valid_re/ ? "okay" : "not okay") . "\n" for @a_bunch_of_inputs;