If you're in OSX, you can use Automator to take screenshots. If you're in Linux, I'm pretty sure that there are similar scripting utilities. Perl isn't always the best solution.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?