in reply to Back substitution expansion

japhy already found the solution..

The perlop manpage tells you a little more about the /e option:

A /e will cause the replacement portion to be treated as a full-fledged Perl expression and evaluated right then and there. It is, however, syntax checked at compile-time. A second e modifier will cause the replacement portion to be evaled before being run as a Perl expression.

MP