| Module Info
| Add a review of File-Copy-Recursive
Module is extremely outdated and has many opened bugs. Better use your own copier instead of this.
Copies directories of files whilst attempting to preservce permissions.
It's the sort of thing you've probably written many times, and never thought to put on CPAN. I'm glad it's here, because saving a little bit of time has helped a big bit.
The ancient non-OO API is horrible, but bearable in small doses.
This module recursively copies directories, preserving permissions like "cp -pr". I was surprised to discover that there are only two recursive copy modules on CPAN: this one and the older File::NCopy.
The File::Copy::Recursive interface is simple enough: dircopy($srcdir, $destdir). However, it is significantly overcomplicated by a pile of poorly-named global variables that allow the user to tweak behavior. The code itself is very hard to read and I had great difficulty tracking down the source of a chmod bug. Update: the bug is fixed and the author is VERY responsive!
The source code to File::NCopy is dramatically simpler, but that module has a rather odd way to signal recursion via a scalar reference that I find annoying.
It would be nice to have something like this in the base installation of Perl. That way, when I subclass Module::Build to have do extra actions upon install (like recursively copying a dir from one place to another), I would have a pure perl way of doing this portably without having to pull extra modules from CPAN. Currently, I've resorted to doing `system("cp -auv $src $dst")` which is fine for systems with GNU/cp, but not for anyone else. Maybe it's a bit too late for perl5 but for perl6, let's think about having a more complete set of file manipulation libs in the base.