in reply to Duplicate Directory Names

File::Find::Duplicate seems to look for files with identical contents. If you just care about identical names, you can use File::Find:
#!/usr/bin/perl -w use strict; use File::Find; find(\&wanted,'.'); use vars qw(%dirseen); sub wanted { return unless -d $_; if ($dirseen{$_}) { print "Duplicate directory name $_ in $File::Find::dir\n"; } $dirseen{$_}++; }

Replies are listed 'Best First'.
Re: Re: Duplicate Directory Names
by tperdue (Sexton) on Oct 18, 2003 at 02:11 UTC
    Thanks for this information. It saved a big headache. Now I've got to go in and rename the duplicates with a one-up sequence number appended to the directory name. I'm hoping that 'rename' will work on directories.
      rename will work fine on directories as long as they're on the same filesystem.