in reply to Seeking a better way to monitor a file's change

An easier way to do so could be using the AnyEvent module.

In the AnyEvent::Intro there is an example that does something very similar to what you are trying to do. See the Introduction to Event-Based Programming section (instead of using STDIN you can obviously use any file handle you want).

It has been implemented in the AnyEvent::Filesys::Notify module.

Just my 2¢.

Alex's Log - http://alexlog.co.cc
  • Comment on Re: Seeking a better way to monitor a file's change