Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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]
Tanktalus is trying to figure out how to get a case-insensitive match between stra▀e and strasse to return true in perl :( fc doesn't seem to do it, either, unless I'm doing it wrong.
[LanX]: ▀,ss
[LanX]: nope
[LanX]: /.*(?:▀|ss).*/
[hippo]: How are you doing the match? Regex, index, eq or something else?
[choroba]: fc $s1 eq fc $s2 I guess
[Tanktalus]: hippo: I don't care, I just want to prove it can match correctly compared to, say, ILIKE / UPPER / LOWER in postgres :)
[LanX]: is there a unicode convention that ▀ is ss ?

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2018-03-21 15:37 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (268 votes). Check out past polls.