zhangpengfei00 发表于 2018-8-31 13:26:46

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]
查看完整版本: perl监控目录变化