in reply to Re^2: Combining multiple =~ s/
in thread Combining multiple =~ s/
It might be worth pointing out the CPAN module Data::Munge which has a function list2re to make a list-matching regex. This line is basically what you need:
my $re = join '|', map quotemeta, sort {length $b <=> length $a || +$a cmp $b } @_;
There is also this, which is what I use.
|
|---|