There are no arrow operators in strings, the right hand side of the s///ubstitution operator s{regex}{right} is a string, unless you use the /e modifier to signal that its code; so use s///e for code (one e is code, two ee is eval, three eee is eval eval --- insane )