http://qs1969.pair.com?node_id=608940


in reply to Re: The 'g' modifier in compiled regex
in thread The 'g' modifier in compiled regex

Likewise, the /e modifier is a modifier for the substitution step of s///, which is even one step further away from the regex (qr//) than /g, so that even m//can't use it.

In Javascript, that borrowed a lot from Perl, the /g is indeed attached to the regex for replace, but IMnsHO, that was a design mistake. It should have been a property, or a separate parameter, of replace.