怎么在 Mac 下制作可启动 PC 的 Windows Bootable 安装启动盘?相信很多人都有类似的经历。硬件组装完成之后,就需要安装操作系统了。但是如果没有现成的系统光盘或者USB工具怎么办
无论你是想在Windows操作系统上学习Perl语言的核心功能,还是想了解下面这类面向Windows的Perl集成工具,你都必须从同一个地方开始,这就是在Windows上安装Perl。
1.下载并安装Perl-5.8-win32-bin.exe及近似版本;
下载地址
2.安装apache 2.0以上版本
下载地址
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-scriptPerlHandler ModPerl::RegistryOptions ExecCGIallow from allPerlSendHeader On</Location>
此处"c:/perl/"为activeperl的安装目录,建议安装在盘符根目录下。
<!--[if !supportEmptyParas]--> <!--[endif]-->
然后重起apache,就可以在c:/perl目录下编写自己的perl CGI程序了。
<!--[if !supportEmptyParas]--> <!--[endif]-->E.g.:hello.pl#!/usr/bin/perluse 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]-->