Help for this page
my %ch = ('green' => 'lousy', 'blue' => 'cool', ... my $regex = qr/$keyList/; $str =~ s/$regex/$ch{$1}/g; print $str ;
my %ch = ('green' => 'lousy', 'blue' => 'cool', ... I have a green hat, blue shirt, plus a pink jacket I have a lousy fedora, cool shirt, plus a mini jacket