The problem about only reading the first line of the string was raised and fixed in the first post of this thread.
Your solution doesn't work. For example,
print(rot13s(rot13s('AN')), "\n");
prints 'AA' or 'NN' (depending on the hash ordering), but not the expected 'AN'.
You also don't escape the keys and value of %rot as you should. The OP said this is a simplification of his problem, so the presense of punctuation in %rot is likely.
Refer to an earlier post of mine for a working solution using eval to build a substitution and a working solution that uses substitution without using eval.
"[rot13s] is only 52 times slower than [rot13tr]" makes no sense. I think you meant "rot13tr is only 52 times faster than rot13s".
*Only* 52 times faster? So if rot13tr takes 30 seconds — The OP said he had lots of data to process — rot13s takes *only* 26 minutes? I wish my 30 minutes drive home every night only took 30 seconds.
In reply to Re^2: The indisputable speed of tr///
by ikegami
in thread The indisputable speed of tr///
by radiantmatrix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |