文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页资讯教你一招 → Windows下的Perl activeperl安装步骤

Windows下的Perl activeperl安装步骤

时间:2011/5/23 9:00:16来源:飓风整理作者:佚名我要评论(0)

无论你是想在Windows操作系统上学习Perl语言的核心功能,还是想了解下面这类面向Windows的Perl集成工具,你都必须从同一个地方开始,这就是在Windows上安装Perl。

1.下载并安装Perl-5.8-win32-bin.exe及近似版本;

Perl语言解释器-ActivePerl for WindowsV5.163.1603
授权:免费软件 大小:23.9M 语言: 英文

2.安装apache 2.0以上版本

Apache HTTP Serverv2.0.55官方版
授权:免费软件 大小:5.8M 语言: 英文

3.通过命令行安装mod_perl,命令如下:

C:> ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd

4,更改apache配置文件conf/ httpd.conf

在loadmodule处添加如下两行:

LoadFile "c:/perl/bin/perl58.dll"

LoadModule perl_module modules/mod_perl.so

在配置文件最后添加:

Alias /perl/ "c:/perl/"
PerlModule ModPerl::Registry
<Location /perl>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Location>

此处"c:/perl/"为activeperl的安装目录,建议安装在盘符根目录下。

<!--[if !supportEmptyParas]--> <!--[endif]-->

然后重起apache,就可以在c:/perl目录下编写自己的perl CGI程序了。

<!--[if !supportEmptyParas]--> <!--[endif]-->
E.g.:hello.pl
#!/usr/bin/perl
use strict;
use CGI;
my $query = new CGI;
print $query->header;
print $query->start_html(-title=>"show hello");
print "<h1>";
print "hello,world!!";
print "</h1>";
print $query->end_html;
exit(0);
<!--[if !supportEmptyParas]--> <!--[endif]-->
<!--[if !supportEmptyParas]--> <!--[endif]-->

template模块windows环境下的安装及测试如下:

1.命令行安装:

ppm2 install http://theoryx5.uwinnipeg.ca/ppms/Apache-Template.ppd

或者使用ppm,(just test it!)

2.创建template.pl于c:/perl下:

<!--[if !supportEmptyParas]--> <!--[endif]-->
use Template;
<!--[if !supportEmptyParas]--> <!--[endif]-->
my ($type) = "text/html; charset=gbk";
print "Content-type: ", $type, "
";
<!--[if !supportEmptyParas]--> <!--[endif]-->
my $config = {
INCLUDE_PATH => 'C:/test',
EVAL_PERL  => 1,
};
<!--[if !supportEmptyParas]--> <!--[endif]-->
my $template = Template->new($config);
<!--[if !supportEmptyParas]--> <!--[endif]-->
my $replace = "要放入模板的變數";
my $vars = {
var => $replace,
};
<!--[if !supportEmptyParas]--> <!--[endif]-->
my $temp_file = 'template.html';
my $output;
$template->process($temp_file, $vars, $output)
|| die $template->error();
<!--[if !supportEmptyParas]--> <!--[endif]-->
print $output;
<!--[if !supportEmptyParas]--> <!--[endif]-->

创建template.html于c:/test下

<html>
<head>
<title>Arthur Dent: Greet the Planet</title>
</head>
<body>
dfsdf [% var %]
</body>
</html>
<!--[if !supportEmptyParas]--> <!--[endif]-->

这样我们就可以在浏览器中输入:http://localhost/perl/template.pl来测试我们的程序。

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

<!--[if !supportEmptyParas]--> <!--[endif]-->

相关视频

    没有数据

相关阅读 perl是什么教你perl获取空间的代码this game was not properly authenticated at launch time解决方ActivePerl PerlIS.dll 远程缓冲区PerlScript编写ASPWin2000+Apache+MySql+PHP4+PERL安装使用小结Win98搭建调试ASPPERLPHP三种环境用PERL实现一个简单的NIDS

文章评论
发表评论

热门文章 电视盒子怎么看百度云迅雷9怎么关闭右侧 迅迅雷99.99下载不完怎么网易云音乐怎么上传歌

最新文章 2022支付宝万能福扫福微信迎新春状态怎么设 微信小老虎头像怎么设置 微信ID后面设置小老抖音压岁钱卡怎么获得2022 抖音压岁钱获取方微博隐私保护怎么设置 微博隐私保护功能完善今日头条2022年集卡活动开启时间 今日头条2

人气排行 智学网怎么登录 智学网怎么查分数 智学网统教你怎么写电子邮箱格式?以163和QQ邮箱为例腾讯大王卡用了后悔怎么办 腾讯大王卡值得办缺少或丢失xinput1_3.dll解决方法,xinput1应用程序无法正常启动0xc000007b解决方法快播关闭怎么办?快播不能用了怎么看片将pdf文件转换为word文件的最简单方法如何破解QQ空间密码和权限