Name: Max Maischein
Email: [EMAIL PROTECTED]
Homepage: <none>
Preferred user-ID: CORION

I have some different modules on the backburner, but one that has neared
completion (in the "I want to add it to CPAN after I discuss it on
Perlmonks"-sense) - the current name of the module is File::Dependencies. It
is a wrapper that allows to easily check whether a list of files changed
(timestamp or MD5) since the last check.

I'm not yet sure if the module name is OK, so if anybody wants to see what
the module is about, appended is the SYNOPSIS part of the POD. Another name
already suggested was "File::Modified".

Thanks,
-max

  use strict;
  use File::Dependencies;

  my $d = File::Dependencies->new(Files=>['Import.cfg','Export.cfg']);

  while (1) {
    my (@changes) = $d->changed;

    if (@changes) {
      print "$_ was changed\n" for @changes;
      $d->update();
    };
    sleep 60;
  };

Second example - a script that knows when any of its modules have changed :

  use File::Dependencies;
  my $files = File::Dependencies->new(Files=>[values %INC, $0]);

  # We want to restart when any module was changed
  exec $0, @ARGV if $files->changed();



Reply via email to