in reply to Re^2: Regexp matched part to lower case
in thread Regexp matched part to lower case

the right hand side will be evaluated. Thus, treat it not as surrounded by quotes, but as an expression.

like:

s/.../"<idl package=\"".lc($1)."\" name=\"$3\" anker=\"$4\"\/>"/ge

Update: sorry, forgot the "'s