use Linux::Inotify2; my $watch_dir = './watch'; my $inotify = Linux::Inotify2->new or die $!; $inotify->watch( $watch_dir, IN_CREATE | IN_MODIFY | IN_DELETE, sub { my $e = shift; my $fullpath = $e->fullname; say "modified: $fullpath" if $e->IN_MODIFY; say "created: $fullpath" if $e->IN_CREATE; say "deleted: $fullpath" if $e->IN_DELETE; } ); $inotify->poll while 1; ࣮1FSMͰ ͬͯ·ͨ͠