in reply to Transforming "\r\n" to '\012\015'

I'm not sure where you're going with this, but printf (see sprintf for full details) will output octal, if that's any help?

perl -E 'printf("%#o\n",ord($_)) for split("","\r\n");' 015 012