note
MikeTaylor
Thank you to all of you who have suggested the form <tt>s/(?$flags:$pattern)/$replacement/</tt>. I think this will get me much of what I need. The fact that the global-replace flag "g" doesn't work in this position is an annoying wrinkle, but I am going to take a deep breath and code up the with-g and without-g cases separately, depending on whether or not <tt>$flags =~ s/g//</tt> succeeds.
11124218
11124222