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


in reply to Is there any way to put regex modifiers into a variable?

 print $line if ($line =~ /$regex/$opts);
Make that
print $line if ($line =~ /(?$opts:$regex)/);