moked has asked for the wisdom of the Perl Monks concerning the following question:

Hi

How do I make the unix system command: cp
as a part of a perl script
while overwriting the existing file

Moked

Replies are listed 'Best First'.
Re: unix cp
by broquaint (Abbot) on Jun 17, 2003 at 13:11 UTC
    You could always use the system function like so
    system("cp src dest") == 0 or warn "ack - 'cp' had problems\n";
    But a better idea might to just do a simple rename, or perhaps use the cp function from File::Copy.
    HTH

    _________
    broquaint

Re: unix cp
by naChoZ (Curate) on Jun 17, 2003 at 13:04 UTC
    You might want to take a look at the perl power tools site for the perl cp command there.

    ~~
    naChoZ

•Re: unix cp
by merlyn (Sage) on Jun 17, 2003 at 17:37 UTC
Re: unix cp
by Aristotle (Chancellor) on Jun 17, 2003 at 13:10 UTC
    Your question is unclear. Can you describe what you want to happen? (Rather than what tools you might do that with.)

    Makeshifts last the longest.