Other than the densification I would perform e.g.
sub signature { my ($self) = @_; my @stat = stat $self->{Filename} or die "Couldn't stat '$self->{ +Filename}' : $!"; return $stat[9]; };
=>
sub signature { return -M $_[0]->{Filename} or die "Couldn't stat '$_[0]->{Filena +me}' : $!"; };
It seems like you'd be better off using MTIME as a screen, and then if and only if MTIME is unchanged do further testing. Afterall, a stat is cheaper than a slurp and hash.

As for the name I would think File::Modified might be more appropriate.

UPDATE: Perhaps I should explain the logic behind determining if something is changed. Mtime in and of itself is not complete as one may touch a file node to it's initial setting after editing. Hence we try a different method to check for difference if the Mtime is not changed. If the Mtime is changed, we accept this. Although the inode may have been touched to affect this change, that is acceptable. On the whole this is not such a large performance boost (it only save you a hashing when Mtime is different) but it does (at least to me) present a more comprehensive system.

Also if performance is of concern, or may be for the users, you may consider hashing only a portion of the file. Say the first 32K, or the first and last 16K, etc. since the Digest module reads the entire file into memory with the addfile method.

--
perl -pe "s/\b;([mnst])/'\1/mg"


In reply to Re: File::Dependencies - a new module looking for a good name (and more discussion) by belg4mit
in thread File::Dependencies - a new module looking for a good name (and more discussion) by Corion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.