in reply to Copying files between directories. How can I improve this code.
Some readability could be gained by some indentation. A run through perltidy wouldn't hurt.
Check the return of opendir. In checking it and chdir, include the $! variable in the error message.
Look into strict and warnings, when you're ready to try that again, it'll mostly involve just putting my in front of the first occurance of every variable, but try to understand the what and why of it.
There is no need to quote your arguments in copy().
Your basic method is sound, though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copying files between directories. How can I improve this code.
by richill (Monk) on Apr 22, 2006 at 00:26 UTC | |
by adrianh (Chancellor) on Apr 22, 2006 at 17:26 UTC |