in reply to Re: Perl process to constantly detect the time change of a file?
in thread Perl process to constantly detect the time change of a file?
while(1) { my $modtime = (stat($file))[9]; if ($modtime == $lastaccessed) { # The file is the same } else { # File is different; do whatever, and also: $lastaccessed = $modtime; } sleep 5; }
|
|---|