NAME

CSS::Watcher::Monitor - Monitor files for changes.

SYNOPSIS

use CSS::Watcher::Monitor;
my $cm = CSS::Watcher::Monitor->new (dir => '/foo/bar');

# return num of files modified
$cm->scan(
          sub {
              my $file = shift;
              # process changed file or first scan new file
              } );

# Check does file changed since last $cm->scan
say $cm->is_changed('/foo/bar/baz.txt');

# clean old file stat cache
$cm->make_dirty();

DESCRIPTION

Watch for changes, call callback sub. Call callback on first scan too.

SEE ALSO

File::Monitor - I get some patterns from there

AUTHOR

Olexandr Sydorchuk (olexandr.syd@gmail.com)

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Olexandr Sydorchuk

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.