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)/);
In Section
Seekers of Perl Wisdom
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)/);