perl监控目录变化
use File::ChangeNotify;
my $watcher =
File::ChangeNotify->instantiate_watcher
( directories => [ '/my/path', '/my/other' ],
filter => qr/\.(?:pm|conf|yml)$/,
);
if ( my @events = $watcher->new_events() ) { ... }
# blocking
while ( my @events = $watcher->wait_for_events() ) { ... }
页:
[1]