sub file2sha1 { my $file = $_[ 0 ]; return '' if -d $file; #have to find out if to prune when a directory is found that doesn't match the regex open my $f, '<:raw', $file or do { warn "Cannot open '$file' $!"; return; }; my $sha1 = Digest::SHA1->new; $sha1->addfile( $f ); return $sha1->digest; }