When you open and read a directory, the names that you get don't have leading path components. Unless you're chdir()'d to the directory, you'll need to prepend the path before doing operations like -d, -e, or rename().
In your case, that means prepending $line or $newdir.
In reply to Re: Renaming Files
by dws
in thread Renaming Files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |