=head1 NAME

Directory::Diff::Copy - Copy differences between two directories

=head1 SYNOPSIS

   use Directory::Diff::Copy 'copy_diff_only';
   copy_diff_only ($old_dir, $new_dir, $output_dir);

=head1 FUNCTIONS

=head2 copy_diff_only

   copy_diff_only ($old_dir, $new_dir, $output_dir);

Given directories specified by C<$old_dir>, C<$new_dir>, and
C<$output_dir>, this compares the files in C<$old_dir> and C<$new_dir>
using L<Directory::Diff/directory_diff>, and puts the differing files
only from C<$new_dir> into C<$output_dir> using L<File::Copy/copy>. If
C<$output_dir> does not exist, this creates it. If C<$output_dir> does
exist, this removes all files from it using L<File::Path/rmtree>
before copying. New directories are made using L<File::Path/mkpath>.

The return value is the number of files copied. This value is useful
to detect whether anything was actually copied or not.

    if (copy_diff_only ($o, $n, $t)) {
        # we have actually copied things, so do something
    } else {
        # nothing copied, don't need to do any more work
    }

An optional fourth parameter switches on debugging information if set
to any true value:

    copy_diff_only ($old_dir, $new_dir, $output_dir, 1);

The debugging information is printed to standard output. It specifies
each file that has been copied.

=head1 SEE ALSO

Directory::Diff::Copy is part of the L<Directory::Diff>
distribution. See the documentation of L<Directory::Diff> for full
details of author, copyright, licence and version.
