in reply to How to ensure duplicate directory and file tree, but not file contents themselves?
The UNIX diff utility already contains that exact function. When presented with two directories as arguments, it compares filenames (ignoring contents) and reports the differences.
If you really wanted to do it in Perl, however...I would do what you suggested, but with one small modification. Instead of building two arrays and iterating them both at the end for equality, just create a hash of all the filenames on the first run of find...then check "on-the-fly" during the second run. It's more efficient.
|
|---|