开发者

PERL file runs only on apache restart on xampp

开发者 https://www.devze.com 2023-03-15 11:32 出处:网络
I am running my perl file on XAMPP. First time I execute it then it works O开发者_如何学运维K, but when I refresh it then it doesn\'t run. To make it run, I have to restart apachee. Can anybody please

I am running my perl file on XAMPP. First time I execute it then it works O开发者_如何学运维K, but when I refresh it then it doesn't run. To make it run, I have to restart apachee. Can anybody please let me know the reason and solution?

PERL CODE IS: code

#!"D:\xampp\perl" 
print "Content-type:text/html\n\n"; 
print "<H1>Hello World</H1>\n"; 
require 'D:\xampp\htdocs\sa\settings.pl';


print "Content-type:text/html\n\n"

Why aren't you using the CGI module with it's header method?

When I remove "require " Then it works fine

Then your error_log file should tell you what is going wrong. You don't check for the files existence before requiring it. You should also be including:

use strict;
use warnings;
use diagnostics;

and test running the file from the command line. You should read up on debugging Perl and CGI programs.

0

精彩评论

暂无评论...
验证码 换一张
取 消