http://qs321.pair.com?node_id=872113


in reply to Re^2: File::Monitor problem with batch files
in thread File::Monitor problem with batch files

It actually was working just as it should work. I called scan twice, so it shut down. I don't think that you need a while loop. For example, you can turn on the monitor, and it will dutifully observe what it's supposed to watch:
#!/usr/bin/perl use strict; use warnings; use File::Monitor; my @Files = qw(1.doc 2.doc 3.xls); my $wFileMonitor = File::Monitor->new(); foreach my $wFile(@Files){ $wFileMonitor->watch($wFile); } $wFileMonitor->scan;
Now the monitor is on. It will stay on until you call the second scan---then it reports the changes and shuts off.