📄 00000096.htm
字号:
output will be generated. <BR> [! Perl code !] is basically the same as [- Perl code -] but the code <BR> will only be executed on the first request. This way of calling Perl <BR> code can be used for defining subroutines or doing initializations. <BR> [$ Cmd Arg $] HTML::Embperl has a set of meta-commands that allow you to <BR> do things like: <BR> <BR> [$ if $ENV{REQUEST_METHOD} eq <BR> <BR> 'GET' $] <BR> <BR> Method was GET <BR> <BR> [$ else $] <BR> <BR> Method other than GET used <BR> <BR> [$ endif $] <BR> that cannot be done just by inserting plain Perl code because statements <BR> like (...) {...} else {...} have to be contained within a single pair of <BR> brackets. <BR> When you use HTML::Embperl, the pages are cached much like normal Perl <BR> code is cached; the page and Perl code is compiled and stored into memory <BR> the first time the page is requested and each time the file changes. The <BR> page is not cached as a static page so the code will be executed (but not <BR> loaded and recompiled unless the file changes) on each request. <BR> CPAN <BR> The Comprehensive Perl Archive Network (CPAN) is a globally mirrored <BR> archive that contains a huge number of Perl modules. If the modules that <BR> come with Perl (or even mod_perl) lack something, this is the place to <BR> look. For a list of CPAN sites you should check the "perlmodlib" manual <BR> page that comes with Perl 5 or just visit www.perl.com. <BR> To make it easier to find, manage, and install Perl modules there is also <BR> something called the "CPAN shell" that will present you with a command <BR> line interface through which you can search for and install modules. Be <BR> warned, though: The CPAN shell won't always work as well as you'd want and <BR> sometimes manual intervention is needed in order to make things work <BR> properly. <BR> Nevertheless, the CPAN shell is very practical in day to day use and it <BR> can simplify installation if you end up needing to install more than one <BR> package due to dependencies between packages. <BR> The mod_perl home page is located at <A HREF="http://perl.apache.org/">http://perl.apache.org/</A> and you will <BR> find everything you need in terms of software, documentation, and links to <BR> interesting information from that site. Start by downloading just the <BR> mod_perl package (and of course Apache) and build an Apache Web server <BR> with mod_perl first. Then, as you familiarize yourself with mod_perl you <BR> can start downloading and try out the various packages that can extend <BR> mod_perl to fit your needs. <BR> PHP or mod_perl? <BR> Throughout this article I've tried to give a balanced introduction to what <BR> PHP and mod_perl can offer when used in conjunction with Apache. The <BR> packages cater to slightly different audiences perhaps and I would <BR> hesitate to say that one is inherently better than the other. <BR> If you are considering which Web server infrastructure to offer your <BR> users: install both and let users use whatever they like more. If you are <BR> planning to undertake a large project, give both packages a spin and <BR> listen to your developers after they've tried out both and familiarized <BR> themselves with the software. <BR> To the new user, I would recommend starting with PHP, though. It is easy <BR> to understand and easy to use. Also PHP 3.0 seems to be more common these <BR> days than mod_perl. I have completed several large projects using PHP and <BR> never regretted the choice. <BR> <BR> <BR> <BR> Bjorn Borud is a partner of Guardian Networks (www.guardian.no) in Norway <BR> where he also works as a developer and consultant. Guardian Networks <BR> specializes in Internet security, Unix, and creating the magic behind the <BR> scenes for Web sites. Bjorn can be reached at <A HREF="mailto:borud@guardian.no.">borud@guardian.no.</A> <BR> <BR> <BR> <BR> <BR> <BR> <BR>-- <BR> 你若想要自由、爱情和快乐 <BR> 就只有用你的信心、决心和爱心去换取 <BR> 除此之外绝对没有别的法子,不是吗? <BR> <BR>※ 修改:·minix 於 Mar 18 18:24:32 修改本文·[FROM: 159.226.41.165] <BR>※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 159.226.41.165] <BR><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -