http://www.perlmonks.org?node_id=1231692

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

Hello Monks,

I have a file that looks like this:

Solar system has 8 planets.

Earth is the only planet where life exists.

best part of the place is sunset.

kayak nyc nurse.

solar winds.

Colors seen in flowers are blue, pink, and purple.

name city job.

country .

Some of the other plantes are mars, jupitor and neptune.

ny.

water the plants.

solar power.

Colors seen in flowers are blue, pink, and purple.

name city job.

country.

My requirement is whenever the sentence comes "solar winds", the next 3rd line "country" should change to "place" and whenever the sentence "solar power" comes, the next 3rd line must change to "wrong line". the file has this in multiple places, multiple number of times. I have to write this in perl script. Anyone has any ideas?