Mercurial > org-tools
view auto-weave.pl @ 6:5370428e673e
experimenting with a perlscript for weaving
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 24 Oct 2011 09:29:17 -0700 |
parents | |
children | ce96610fe058 |
line wrap: on
line source
1 #!/usr/bin/perl3 use Linux::Inotify2;4 use AnyEvent;7 my $inotify = new Linux::Inotify28 or die "unable to create new inotify object: $!";11 @org_files = glob("./org/*.org");13 $" = "\n";14 print "@org_files";17 foreach(@org_files){18 # add watchers19 $inotify->watch ($_, IN_MODIFY, sub20 {21 my $e = shift;22 my $name = $e->fullname;23 print "$name was modified\n" if $e->IN_MODIFY;24 `26 });31 }36 # integration into AnyEvent (works with EV, Glib, Tk, POE...)37 my $inotify_w = AnyEvent->io38 (39 fh => $inotify->fileno, poll => 'r', cb => sub { $inotify->poll }40 );42 # manual event loop43 1 while $inotify->poll;