in reply to manipulating capture groups in s///

Yes, you'll run into trouble, you should have used the /e flag. It causes the right side of your expression to be executed and its return value is used as the replacement.

s((bar))(foo($1))ge

Replies are listed 'Best First'.
Re^2: manipulating capture groups in s///
by Aristotle (Chancellor) on Nov 11, 2003 at 19:57 UTC
    Neat way to parenthesize. I need to remember this for obfuscations. :)

    Makeshifts last the longest.