diff -ruN Module-ScanDeps-1.09/lib/Module/ScanDeps/Cache.pm Module-ScanDeps-1.09-new/lib/Module/ScanDeps/Cache.pm --- Module-ScanDeps-1.09/lib/Module/ScanDeps/Cache.pm 2012-02-21 07:25:42.000000000 -0800 +++ Module-ScanDeps-1.09-new/lib/Module/ScanDeps/Cache.pm 2012-10-18 04:31:16.312500000 -0700 @@ -57,7 +57,7 @@ } ### check for existence of the entry -### check for identity of the file +### check for identity of the file, ONLY if mtime is different ### pass cached value in $mod_aref ### return true in case of a hit @@ -66,6 +66,14 @@ my ($key, $file, $mod_aref) = @args{qw/key file modules/}; return 0 unless (exists $cache->{$key}); my $entry = $cache->{$key}; + + my $mtime = ( stat $file )[9]; + if (exists $entry->{mtime} and $entry->{mtime} == $mtime ){ + ## if mtime hasn't changed, don't bother with md5, its faster + @$mod_aref = @{$entry->{modules}}; + return 1; + } + my $checksum = _file_2_md5($file); if ($entry->{checksum} eq $checksum){ @$mod_aref = @{$entry->{modules}}; @@ -81,6 +89,7 @@ my $checksum = _file_2_md5($file); $entry->{checksum} = $checksum; $entry->{modules} = [@$mod_aref]; + $entry->{mtime} = ( stat $file )[9]; ## cause md5 is slow $cache_dirty = 1; return 1; } diff -ruN Module-ScanDeps-1.09/lib/Module/ScanDeps.pm Module-ScanDeps-1.09-new/lib/Module/ScanDeps.pm --- Module-ScanDeps-1.09/lib/Module/ScanDeps.pm 2012-09-04 13:38:32.000000000 -0700 +++ Module-ScanDeps-1.09-new/lib/Module/ScanDeps.pm 2012-10-18 04:33:48.578125000 -0700 @@ -4,7 +4,7 @@ use warnings; use vars qw( $VERSION @EXPORT @EXPORT_OK @ISA $CurrentPackage @IncludeLibs $ScanFileRE ); -$VERSION = '1.09'; +$VERSION = '1.0901'; @EXPORT = qw( scan_deps scan_deps_runtime ); @EXPORT_OK = qw( scan_line scan_chunk add_deps scan_deps_runtime path_to_inc_name );