in reply to creating a perl script

But I may have issue as the words occur multiple times.

Use Regular expression to match multiple lines with m modifier.

To run the script for every fifteen minutes, use sleep function.