in reply to Has my Perl Go Crazy?
The statement @list=<DIR>; after the file open will typically read all newline terminated lines from the file to the array. Each line, if I understand correctly, is a file name.
You then iterate through this array of newline terminated file names with foreach $tmp(@list) { ... }.
Without removing the newline, you try to use the file name in $tmp in a statement like `copy $source\\$tmp $dest\\$tmp`;. A little experimentation shows that the Windows copy function will take a newline in the middle of the string as the end of the command. This will look like copy somewhere\else\file.name and copy to the current directory.
This may be a part of your problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Has my Perl Go Crazy?
by scorpio17 (Canon) on Aug 27, 2008 at 15:33 UTC | |
|
Re^2: Has my Perl Go Crazy?
by jdporter (Paladin) on Aug 27, 2008 at 15:51 UTC |