use Linux::Inotify2; my $target = '/home/tart'; my $in2 = Linux::Inotify2->new(); die "Inotify2: $!" if (! defined $in2 ); $in2->watch ($target, IN_CLOSE_WRITE, \&translate_event) or die "watch: $!"; $in2->poll while 1; # blocking call # User written callback sub translate_event { my ($ev) = @_; if ($ev->fullname eq 'config.cfg') { # File was written to (and closed), so run the script system(script.pl); # or whatever if ($?) { # Oops, it failed } } }