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

Re: What is the easiest way to copy one file to another?

by jwest (Friar)
on Oct 31, 2001 at 01:12 UTC ( #122202=note: print w/replies, xml ) Need Help??

in reply to What is the easiest way to copy one file to another?

For a more fun, but less portable and unrecommended solution...

link($oldfile, $newfile); unlink($oldfile);

But you should really be using File::Copy as ar0n suggests.

Update: Which, of course, actually performs a rename and not a copy. So, it's doubly true that File::Copy should be used instead.

-><- -><- -><- -><- -><-
All things are Perfect
    To every last Flaw
    And bound in accord
         With Eris's Law
 - HBT; The Book of Advice, 1:7

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2016-10-28 21:41 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (387 votes). Check out past polls.