in reply to Substitution Operator

If you are just wanting to substitute a single letter, the above tr solution is recommended. However, if you wanted to replace an entire string throughout your $text variable, you'd want to use the s///g construct.

Since this also works for single letters, a slightly less optimized solution than tr/j/p/ is:

$text =~ s/j/p/g;
Your code could also benefit from use strict; which will help you practice good coding style, and taint checking which will help you realize the inherant insecurities of passing user input directly to system calls.

-Blake