1) Put "sleep 300" in the perl file and run it infinitely
2) Use shell script and use that

These two are easier than C program. C++ - Never reinvent the wheel