in reply to File::Copy versus cp/mv
Depends. Are you doing this from within a performance critical program? If this were code running under mod_perl, f.ex, I wouldn't be pleased that someone forks an entire Apache willy nilly.
But if they're simple maintenance scripts or such, there's not much wrong in using the Unix toolbox if Unix is what you're going to run on.
There's something they need convincing of though: avoid the shell whenever you can reasonably do so.
And if filenames can contain metacharacters, glob them yourself. Going through the shell can easily cause unexpected behaviour if you're not careful, and it's very easy to not be careful enough.system(cp => $foo, $bar); system(mv => $foo, $bar);
Makeshifts last the longest.
|
|---|