#! /usr/bin/perl
use Linux::Inotify2;
my $inotify = new Linux::Inotify2;
$inotify->watch('/home/zhli/app/apache2/cgi-bin/', IN_MODIFY | IN_CREATE | IN_MOVED_TO,
sub {
my $e = shift;
my $fullpath = $e->fullname;
$fullpath =~ s/\/\//\//;
chmod 0755, $fullpath;
#print $fullpath;
#print $e->{w}{name}."\n";
#print $e->{name}."\n";
#print $e->fullname."\n";
#$e->w->cancel;
});
1 while $inotify->poll;