perl编写的cgi程序怎么才能运行
我的机子已经有了omnihttpd2.01和perl for window的软件
建立了服务器的环境、请提供一个完整的、简单的perl程序给我
运行一下试一试!!一定要简单的
最好是从客户端提交表单以后运行!!
谢谢~~
推荐阅读
#http://localhost/cgi-bin/test.pl?a=b&c=d
#test.pl
#!c:/perl/bin/perl.exe
print "content-type:text/html\n\n";
print "hello, world<br>";
print getenv("query_string");
你最好装个金山词霸,或者买本英汉词典,碰到问题查一查。
服务器没有找到你的程序文件。
要把test.pl放在服务器的cgi-bin的目录下!!
perl解析模块的配置文件没配好吧?
gz
1.安装完activeperl,iis就自然支持perl了。
2.<html>
<head>
<title>example4-2-1</title>
</head>
<body>
<h3>get environment variables relating to server, ok?</h3>
<hr>
<form action="/cgi-bin/getenv1.pl" method=get>
<input type=submit value="submit">
</form>
</body>
</html>
3.
# 显示与服务器有关的环境变量的cgi程序getenv1.pl
#!/user/bin/perl
print "content-type: text/html\n\n";
print "<html>";
print "<body>";
print "<h2>environment variables relating to server</h2>";
print "<hr>";
print "<b>";
print "gateway_interface: ",$env{gateway_interface},"<br>";
print "server_name: ",$env{server_name},"<br>";
print "server_port: ",$env{server_port},"<br>";
print "server_protocol: ",$env{server_protocol},"<br>";
print "server_software: ",$env{server_software};
print "</b>";
print "<hr>";
print "</body>";
print "</html>";
# end getenv1.pl
是不是权限没有755
cgi-bin目录的权限要设定为“指令和执行档”
.

讨论区