qr// does not appear to be designed to encapsulate the entire regex substitution expression, only the portion of it that would ordinarily be contained in the match section. I need something that will allow the substitution to be flagged for case-insensitive matching via the //i operator, in addition to the other portions (match / substitute) of the operation coming from user input (variable).
For example, trying this did not work for me:
$substitution = qr/s~$sv$ch$ww$regexM$ww$ch$ev~$regexR~g$regexI/;
$line =~ $substitution;