宝宝妈SEA12007-05-31 04:58:54
请知道的朋友给指点一下。

这 是 我 的 CODE:

#!C:\perl\bin\perl.exe -wT
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

my $q = new CGI;
print $q->header;
print $q->start_html(-title=>'writing to a file');

open csv_file, "> /test.txt" or die "Could not open file$!";
print csv_file "It is a test!!!\n";
close csv_file;

print $q->end_html();

我 想 把 “It is a test!!!”写 到 Apache 的 DocumentRoot 下 一 个 叫 test.
txt 的文 件 里, 可 是 我 运 行 这 个 CODE 后, test.txt里 什 么 都 没 写 上
。 请 问 知 道 的 朋 友 这 是 为 什 么 ? 我 如 何 才 能 把 内 容 写 到
DocumentRoot 下 的 文 件 ?

我 装 的 是 Apache for WindowsXP.
test.txt 是 放 在 DOCUMENTROOT C:\Program Files\Apache Group\Apache\htdocs
下 的。

多 谢
maychan19702007-06-01 15:09:31
You may get your answer if posting it in www.perlmonk.org.