in reply to Error Handling

I'm a little confused at what is writing to the logfile, and whether it only contains a list of errors or not. If you're fortunate enough to have a logfile that only contains error messages, all you have to do is keep track of its most recent modification time, or of any size changes. If it gets modified, or if it grows, that means a new error got logged.

If it's not that simple, could you make it that simple by ensuring that errors get logged to some other file too?

If that's not possible, maybe you could use File::ReadBackwards on the logfile and keep reading until you find the most recently reported error message. If, before arriving at that most recently reported error message, other error messages are also discovered, keep track of them and they'll be the basis for your imminent email report.


Dave