'file changed'-event



Hi,

I'm trying to execute a sub whenever a certain file on the disk changes.
Currently, I'm doing this with an infinite loop that checks the modify
time (stat("$file"))[9]. While this works in principle, the infinite
loop drives the CPU crazy and speeds up the fan (very annoying).

Can I implement this with an event-based approach that doesn't drive up
my CPU? How?

Thanks,

Michael Goerz
.



Relevant Pages

  • Re: file changed-event
    ... > I'm trying to execute a sub whenever a certain file on the disk changes. ... I'm doing this with an infinite loop that checks the modify ... > loop drives the CPU crazy and speeds up the fan. ...
    (comp.lang.perl.misc)
  • Re: setting RecursionLimit
    ... You can modify it like so, but in most normal cases the default 500 ... is a large-enough number to indicate you're probably entering an ... infinite loop that should be stopped: ... Yair Altman ...
    (comp.soft-sys.matlab)