in reply to Store regex modifiers in variables?

I would do:
$modifiers =~ tr/cgimosx//cd; # remove illegal mods $regex = eval qq{ qr/\$regex/$modifiers };


japhy -- Perl and Regex Hacker