App-filewatch
view release on metacpan or search on metacpan
bin/file-watch view on Meta::CPAN
$option{type} = $types;
}
else {
$option{type} ||= ['IN_MODIFY', 'IN_MOVE_SELF'];
}
if ( $option{report} ) {
$SIG{INT} = \&report;
}
my $refresh = AE::timer(1, 1, sub { report('changes'); });
AnyEvent::Loop::run;
return;
}
sub watch {
my ($file) = @_;
warn "The file '$file' no longer exists!\n" if !-e $file;
bin/file-watch view on Meta::CPAN
};
$changes{$file}{time} = time;
$changes{$file}{types} = {
%{ $changes{$file}{types} || {} },
map { $_ => 1 }
grep { $evt->$_() }
@{ $option{type} }
};
push @refresh, AE::timer(1, 0, sub { watch($file); });
return;
}
sub report {
my $changes = shift;
my %change = $changes eq 'changes' ? %changes : %changed;
my $files_changed = keys %change;
( run in 1.176 second using v1.01-cache-2.11-cpan-49f99fa48dc )