For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > March 2004 > 'copy $src, $dest;' cannot work. [File::Copy]









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author 'copy $src, $dest;' cannot work. [File::Copy]
ckacka

2004-03-28, 10:22 pm

I use
$link = "$path/$page";
copy './template/file', "$link";
but it does not work.

the $path is absolute path, such as /home/x/x
and the $page is my file name.

thank.


Anno Siegel

2004-03-28, 10:22 pm

ckacka <ckacka@163.com> wrote in comp.lang.perl.misc:
> I use
> $link = "$path/$page";
> copy './template/file', "$link";
> but it does not work.


What happens instead?

> the $path is absolute path, such as /home/x/x
> and the $page is my file name.


Don't describe what you think is in the variables, show what they actually
contain.

Have you read the doc to File::Copy? It suggests

copy("file1","file2") or die "Copy failed: $!";

So, what's in $! after the failed copy?

Anno
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com