【发布时间】:2014-08-14 02:29:30
【问题描述】:
#!/usr/bin/perl
use File::Copy;
print "content-type: text/html \n\n"; #The header
$filetobecopied = "C:\Users\avinash\Desktop\mktg/";
$newfile = "C:\Users\avinash\Desktop\elp/";
copy("$.pdf","$.elp") or die "File cannot be copied.";
上面的程序我用来输出但出现错误任何人都可以帮助我输出代码
【问题讨论】:
-
你能给我们错误信息,让我们看看有什么问题吗?提示:加$!到
"File cannot be copied. $1";。这样你就可以看到来自系统的消息了。 -
抱歉,我没有得到预期的输出,它在 F:\extensionchange.pl 第 6 行的打印中显示如下宽字符错误。无法复制文件。在 F:\extensionchange.pl 第 7 行。
-
如果添加“$!”在消息的末尾,您会得到无法复制的原因。
标签: perl