我是Perl语言的新手,我尝试像运行PHP文件一样运行它,方法是将文件放在htdocs中,然后通过本地主机访问它们。
以下是我创建的Perl文件,但无法在localhost上运行:
----- hello.pl ---------------
#!/usr/bin/perl
print "Hello World.\n";
最佳答案
Hello World 计划:
#!C:\xampp\perl\bin\perl.exe
# The above line is perl execution path in xampp
# The below line tells the browser, that this script will send html content.
# If you miss this line then it will show "malformed header from script" error.
print "Content-type: text/html\n\n";
print "Hello world."
现在,从xampp控制面板启动apache。在浏览器的URL中,输入localhost/perl/hello.cgi。
关于perl - 如何在Windows上通过XAMPP运行Perl文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7860380/