in reply to Re^2: How do I change substitution options within a program?
in thread How can I change substitution options within a program?
Nothing. Maybe he was thinking of the following:
# XXX WRONG DON'T USE THIS $re = qr/$re/i if $opt{i}; $re = qr/$re/m if $opt{m}; $re = qr/$re/s if $opt{s}; $re = qr/$re/x if $opt{x};
On the other hand, the following does work:
$re = "(?i:$re)" if $opt{i}; $re = "(?m:$re)" if $opt{m}; $re = "(?s:$re)" if $opt{s}; $re = "(?x:$re)" if $opt{x};
|
|---|