use Regexp::List qw( ); my @arr = qw( cool guy here ); my $str = "I am cool"; my $re = Regexp::List->new(@arr)->list2re(); if ($str =~ $re) { # if ($str =~ /^$re$/) { print "Matched\n"; # print "Equals\n"; } # }