my $chars = q{abcde}; # Specify the characters. my $matchset = "[$chars]"; # Set up a character class. my $reg_match = qr{$matchset}; # Turn it into a regexp. my @strings = qw/ apple logs frog elmo /; foreach my $string ( @strings ) { print "$_ matched\n" if $string =~ $reg_match; } __END__ apple elmo