in reply to Inserting numbers between parenthese matches in regexp
try curly braces around $1, making it ${1} - now perl finds it unambiguous from meaning $15:
s/([a-m])([n-z])/${1}5$2/g;
Cheers, Sören