in reply to Converting a stringified regexp back into a regexp

Why don't you just $nregexp = qr/$string/;? So you end up with an aditional (?-xism:...) around the regexp if you stringify it again, so what?

Jenda
We'd like to help you learn to help yourself
Look around you, all you see are sympathetic eyes
Stroll around the grounds until you feel at home
   -- P. Simon in Mrs. Robinson

Replies are listed 'Best First'.
Re^2: Converting a stringified regexp back into a regexp
by mirod (Canon) on Apr 07, 2005 at 16:03 UTC

    It makes sense. I still have to figure out that the string is a regexp though (it can also be a regular string), so the extra $nregexp= qr/(?$1:$3)/; is cheap. $nregexp = qr/$string/; might be a little safer though, in case the syntax for regexp changes (but then I would probably have to change the regexp that matches it anyway).