XP is just a number | |
PerlMonks |
Re: 'better mousetrap': how to perform timed eventby Necos (Friar) |
on Apr 24, 2003 at 17:04 UTC ( [id://252955]=note: print w/replies, xml ) | Need Help?? |
Going on tachyon's idea, would it be possible to do something like this?
I would figure, if the size of your log file changes, then you can easily seek to the point in your file that has changed (you do have the old file size), read the data from it (which should be fast if the new data is small), and decide if your event has indeed occured. If it's not your event, just fall out and go back to your polling. If it is, do your magic. Hope that helps some. Update: Not too long after my initial reply, I noticed that BrowserUK posted a much more elegant solution (maybe just a bit overkill?). The general idea still remains the same: check the filesize of your log. YMMV. Good luck. Theodore Charles III Network Administrator Los Angeles Senior High email->secon_kun@hotmail.com perl -e "map{print++$_}split//,Mdbnr;"
In Section
Seekers of Perl Wisdom
|
|