Win8 Strawberry 5.8.9.5 (32) Sat 10/01/2022 17:18:27 C:\@Work\Perl\monks >perl use strict; use warnings; use Data::Dump qw(dd); # for debug my $text = <<'TEXT'; Regular expressions have the undeserved reputation of being abstract and difficult to understand. TEXT print "before ---$text--- \n"; my @regexlist = split /\n/, <<'REGEX'; a A i I e E REGEX my %replace = map split, @regexlist; # dd \%replace; # for debug my ($rx_search) = map qr{ $_ }xms, join ' | ', map quotemeta, reverse sort keys %replace ; # dd $rx_search; # for debug $text =~ s{ ($rx_search) }{$replace{$1}}xmsg; print "after +++$text+++ \n"; ^Z before ---Regular expressions have the undeserved reputation of being abstract and difficult to understand. --- after +++REgulAr ExprEssIons hAvE thE undEsErvEd rEputAtIon of bEIng AbstrAct And dIffIcult to undErstAnd. +++