Follow up to previous question...
I got a great script from Clockwatcher and want to modify it so that it returns not just files added and deleted to the directory, but if existing files have changed since the initial scan. I need the name of the file that changed as a return value,
Here is what I started with:
my $monitor = File::Monitor->new();
name => 'c:/logs',
callback => \&SomethingHappened,
files => 1
for ($i=0; $i < 10; $i++)
my ($name, $event, $change) = @_;
my @adds = $change->files_created;
my @dels = $change->files_deleted;
print "Added: ".join("\nAdded: ", @adds)."\n" if @adds;
print "Removed: ".join("\nRemoved: ", @dels)."\n" if @dels;
I have tried variations of the line:
my @mods = $change(mtime); but haven't had any luck.