in reply to Is there any way to put regex modifiers into a variable?
print $line if ($line =~ /$regex/$opts);
print $line if ($line =~ /(?$opts:$regex)/); [download]