in reply to How can I alert perl to a file write
# could do stat()[9] and not use File::stat use File::stat qw(:FIELDS); $cfgfile = '/my/config/variables.file'; stat($cfgfile) or die "No $cfgfile: $!"; my $last_mtime = $st_mtime; parse_config($cfgfile); #time passes #enter loop of things to do and events to check stat($cfgfile) or die "No $cfgfile: $!"; if ($last_mtime != $st_mtime) { $last_mtime = $st_mtime; parse_config($cfgfile); } # sleep(N) unless something else to do
Dingus
|
|---|