从网页运行Perl脚本

问题描述:

大家好,

当我单击网页上的链接时,我想运行PERL脚本.
我已经将html文件粘贴到了.pl文件所在的位置.我也粘贴了下面的perl文件.

HTML文件:

Hi All,

I want to run a PERL script when one clicks on a link on a webpage.
I have pasted the html file where the .pl file is called. Also i have pasted the perl file below.

HTML File :

<html>
<head>
<title>Run Scriptings</title>
</head>

<script language="JavaScript" type="text/javascript"

src="http://172.19.98.182:8080/haha.pl"

<script>

</body>
</html>




PERL文件:




PERL File :

#!/usr/bin/perl
use Cwd;
use CGI;
$pwd=cwd();
print "Content-type: text/html\n\n";
print "document.write(''I rule the World'');";
#system("mkdir $pwd/DEEPAK");
exit 0;





但是,当我单击链接时……什么也没有出现.出现一个标题为运行脚本"的新窗口,但没有任何显示.没有打印语句...什么都没有!!!

即使我将任何垃圾代码(afsfsfsfdh)写入perl文件...单击链接时也不会显示任何错误...似乎无法读取和执行脚本. >
请提出建议.

谢谢
Deepak





But when i click on the link ... nothing appears. A new window having the title as "Run Scriptings" comes and nothing appears. No print statements ... nothing .!!

Even if i write any garbage code (afsfsfsfdh) into the perl file ... on clicking on the link ... it doesnlt show any error as well ... Just seems its not able to read and execute the script.

Please suggest.

Thanks
Deepak

pwd = cwd(); 打印内容类型:text/html \ n \ n"; 打印"document.write("我统治世界);"; #system("mkdir
pwd=cwd(); print "Content-type: text/html\n\n"; print "document.write(''I rule the World'');"; #system("mkdir


pwd/DEEPAK"); 退出0;
pwd/DEEPAK"); exit 0;





但是,当我单击链接时……什么也没有出现.出现一个标题为运行脚本"的新窗口,但没有任何显示.没有打印语句...什么都没有!!!

即使我将任何垃圾代码(afsfsfsfdh)写入perl文件中……单击链接时……也不会显示任何错误……似乎它无法读取和执行脚本. >
请提出建议.

谢谢
Deepak





But when i click on the link ... nothing appears. A new window having the title as "Run Scriptings" comes and nothing appears. No print statements ... nothing .!!

Even if i write any garbage code (afsfsfsfdh) into the perl file ... on clicking on the link ... it doesnlt show any error as well ... Just seems its not able to read and execute the script.

Please suggest.

Thanks
Deepak


看看是否有帮助:

http://inpics.net/tutorials/perl/basics15.html [
see if this helps:

http://inpics.net/tutorials/perl/basics15.html[^]