Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a file, which I like to modify without creating any additional file.

I have somewhere in the file : A P B and then elsewhere C X P.

A, B and C are fixed item where X and P are not.

I have Q , which is first few characters of P. I like to convert second line C X P to C X Q.

Need help.