NAME

File::Same - Detect which files are the same as a given one

SYNOPSIS

use File::Same;
my @same = File::Same::scan_dirs($original, ['other', '.']);

or
my @same = File::Same::scan_files($original, [@list]);

or
my @same = File::Same::scan_dir($original, 'somedir');

DESCRIPTION

File::Same uses MD5 sums to tell you which files are the same in a given directory, set of directories, or set of files. It was originally written to test which files are the same picture in multiple directories or under multiple filenames, but can be generally useful for other systems.

File::Same will use an internal cache, for performance reasons.

File::Same will also be careful not to return $original in the list of matched files.

API

File::Same::scan_files($original, $list)

Scan a list of files to compare against a given file. $list is an array reference,

File::Same::scan_dir($original, $dir)

Scan an entire directory to find files the same as this one.

File::Same::scan_dirs($original, $dirs)

Scan a list of directories to find files the same as this one. $dirs is an array reference.

All of the above functions return a list of files that match, with their full path expanded.

AUTHOR

Matt Sergeant, matt@sergeant.org

SEE ALSO

Digest::MD5