What is the current working directory for the shell that runs your perl script?
You are using the glob operator in the script's current working directory in order to get the list of directories to search through, so (if windows works like any other normal OS) you shouldn't need to include all that initial stuff ('C:\Documents and Settings\user\Desktop\dir\') when assigning a value to $path. Just put the value of $directory at the beginning of $path.
Apart from that, are you certain that every directory (or any directory) contained in the script's current working directory actually contains a sub-path called '2010\01\01'?
When you say "I get the duplicate message but the files are not being added to the @delete array.", do you mean the output is "There are 0 duplicate files to delete"? If so, the previous questions are relevant.
Do you see the outputs that say "Searching (path_string)"? If so, have you checked and made sure that the path strings in those messages are paths that actually exist? If so, do those paths actually contain any duplicate files? If the answer is "no" to any of that, then the script would seem to be working, in the sense that it can't find any duplicate files to delete.
Update: BTW, your use of grep on the glob is not a good idea, I think, because it allows both "." and ".." to pass through into your @directories array. A better usage would be:
(updated again to put the regex match in front of the more expensive "-d" function call)@directories = grep { /[^.]/ && -d } <*>; # list items must be direct +ories whose # names contain something b +esides '.'
In reply to Re: delete duplicates in windows subdirectories
by graff
in thread delete duplicates in windows subdirectories
by casimo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |