Another hugely important point is the way you handle filenames:
Do not, I repeat NOT use backslashes (\) as the directory separators with Perl under Windows. Use normal forward slashes (/) unless you really want to get anal about replacing each and every occurence of backslash (\) with double backslash (\\) each and every time.
When you perform a system function on a file, such as rename, you should always return, not only the error ($!), but also the filename itself, like so:
rename $old,$new or die "Cannot rename $old to $new:$!\n";
This is because the most frequent cause of error in such cases is a malformed filename.
For example if you tried to rename your file: C:\elmPaul\jod25573786-2k2 and returned the name, you would find that you were actually trying to rename the file:
C:
backslash e = ESC
elmpaul
backslash j = no special meaning
jod25573786-2k2
which probably does not exist.
Regards,
Helgi Briem
In reply to Re: Can't rename all directories but only some
by helgi
in thread Can't rename all directories but only some
by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |