in reply to Regex substitution modifier /r

That syntax was introduced in version perl5140delta. You need to upgrade if you want to use it.