加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何在Windows上通过XAMPP运行Perl文件?

发布时间:2020-12-13 22:55:28 所属栏目:Windows 来源:网络整理
导读:我是Perl语言的新手,我尝试像运行 PHP文件一样运行它,方法是将文件放在htdocs中,然后通过localhost访问它们. 下面是我创建的Perl文件,但无法在localhost上运行: —– hello.pl ————— #!/usr/bin/perl print "Hello World.n"; 安装xampp.在安装过程中,
我是Perl语言的新手,我尝试像运行 PHP文件一样运行它,方法是将文件放在htdocs中,然后通过localhost访问它们.

下面是我创建的Perl文件,但无法在localhost上运行:

—– hello.pl —————

#!/usr/bin/perl
   print "Hello World.n";
>安装xampp.在安装过程中,请确保已检查要安装的perl.
>我假设你已经在c:/ xampp目录中安装了xampp.
>现在转到c:/ xampp / htdocs目录.在htdocs目录里面创建一个perl目录.现在在perl目录中,创建一个名为hello.cgi的文件.
>在hello.cgi中编写以下代码段.

你好世界节目:

#!C:xamppperlbinperl.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/htmlnn";
print "Hello world."

现在从xampp控制面板启动apache.在浏览器的url中,输入localhost / perl / hello.cgi.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读