I don't think that's correct. tr/// can only do character-by-character substitutions, so \n as an escaped new line would be 2.
You'd also have to consider any other extenuating circumstances, like having an escaped slash preceding a normal n. Update
So this perl hacker walks into a bar...