http://www.perlmonks.org?node_id=11124240


in reply to Re^2: Regexp substitution using variables
in thread Regexp substitution using variables

> does not (at least to my eyes) show what the difference is between them.

you are comparing

in your example there is no difference, but in the second approach with pattern the reach of modifiers is limited to the group.

DB<24> p 'xX' =~ /(?i:X)X/ 1 DB<25> p 'xX' =~ /(?i:X)x/ DB<26> p 'xX' =~ /(?i)Xx/ 1 DB<27>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery