App-watchdo
view release on metacpan or search on metacpan
lib/App/watchdo.pm view on Meta::CPAN
414243444546474849505152535455565758596061sub
watch {
my
(
$self
) =
@_
;
my
$notify
= AnyEvent::Filesys::Notify->new(
dirs
=> [
$self
->get_dirs ],
cb
=>
sub
{
my
@changed
=
@_
;
$self
->changed([ @{
$self
->changed },
@changed
]);
if
( !
$self
->done ) {
$self
->done( AE::timer
$self
->
wait
, 0,
sub
{
$self
->doit() } );
}
},
parse_events
=> 1,
);
return
AnyEvent::Loop::run();
}
sub
doit {
my
(
$self
) =
@_
;
( run in 0.255 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )