in reply to Regexp::Common not so common?

I don't believe you can join two regex's together using string concatenation. If you spell it out, it works:
$teststring =~ s/hello\s*$RE{balanced}{-parens=>'{ }'}\s*$RE{balanced} +{-parens=>'{ }'}/hi/; #teststring: start hi end

(Except you didn't have any capture parentheses in your original s///.)


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: Regexp::Common not so common?
by massa (Hermit) on Aug 14, 2008 at 14:34 UTC
    Yes, you can join two regexes together using ".". What you have to do is obey the error message and add
    use re 'eval';
    to your script. See re.
    []s, HTH, Massa (κς,πμ,πλ)