use Regexp::List qw( ); my $re = Regexp::List->new(modifiers => 'i')->list2re(@words);