In my perl program, when I read in a line of text, how can I perform the action of substituting all the words before a certain in the middle of a line. For example:
READIN LINE:
This is a nice weather.
He is a nice guy.
We have some nice food in our dinner.
Substituting everything before " nice" with "A" (though the phrase in front are all different), i.e.
EXPECTING RESULT:
A nice weather.
A nice guy.
A nice food in our dinner.
How can I do this is perl?