How would I go about making a Replace function in CGI/Perl?

If I wanted to replace all the j's in a variable with p's, how could I do it?