How to change the compliance modifier in a program in perl?

$text =~ /"helloworld"/g 

I want to have this regular expression modifdier 'g' in a variable so that later I can change it to another modifier, for example, this "i", "s" and so on.

eg.

 $text="helloworld" $test="helloworld" $modifier="g" $text =~ /$test/$modifier 
+5
source share

All Articles