in reply to checking file everytime a new line is added to file

Another thing to consider is attacking this from a different angle. Rather than have other scripts consult the log file, perhaps have the program that generates the log file initiate the processing. This gives you greater precision in terms of when these people log on and off.

The downside of this is that your code is probably less modular. I suspect that the other processes that you would be inclined to run have little to do with logging someone on and off. Therefore, those processes don't belong in a long script. Perhaps have that script run another Perl program every time someone logs on and off? If you have a high traffic system, this could also be a Bad Thing as it would likely slow everything down. I mention these alternatives to help you consider the possibilities, not that I think they are necessarily appropriate for your situation.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

  • Comment on (Ovid) RE: checking file everytime a new line is added to file