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


in reply to Foreach loop help. Start from specific line

Every script needs to be restartable.   If it were me, I would have put the million names into, say, an SQLite database file and include a “processed?” column which gets updated each time.   I might put summary results of some kind in there also.   Such an approach would not only handle the restart issue, but would also be good for handling the re-run issue.   You will from time to time need to re-query those websites and the script will need to be able to know how to do that, too.

Replies are listed 'Best First'.
Re^2: Foreach loop help. Start from specific line
by Doozer (Scribe) on Oct 22, 2012 at 14:18 UTC
    That is a good point. I am fairly new to perl and this script is the most complex one I have written so far (It branches off sending ssh commands to other Virtual Machines to start counterpart scripts which then loop back so it is all closed loop).

    You are correct about re-querying the websites. We log every hostname that does not respond with '200 OK' to a separate file which will then be run through the test process again.