Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: File::Copy versus cp/mv

by Aristotle (Chancellor)
on Oct 01, 2003 at 16:49 UTC ( #295687=note: print w/replies, xml ) Need Help??

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.

system(cp => $foo, $bar); system(mv => $foo, $bar);
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.

Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://295687]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-08-16 13:41 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (167 votes). Check out past polls.