Integrating PHP and Perl
Perl is a language often associated with text processing and CGI. PHP is
a language often associated with dynamic Web pages. Both are very popular
with Web developers. Often, each of these languages is used at the expense of
the other. Hard-core Perl developers would love to develop everything in
Perl, and PHP developers tend to stick with PHP.
As usual in the Open Source
world, there is a lot of zealotry between users of each language. If you
think that one of these languages is perfect and the other is lame,
this article is not for you! This article is for those who take a more
pragmatic approach and use what works best for them. Each language has
its strengths and limitations. Personally, I use both languages at work
and at home. With time, I have discovered which language is best for which
tasks and
try to integrate the strengths of each language as much as possible to
complete my work quickly.
Perl is extremely good at
system administration and extensive data processing, among other
things. This means, if you want to do some extensive processing on a text
report, Perl would be preferable, as it provides handy
regular-expression-enabled text comparisons, which make it so much easier to
search through a report. Perl also has extensive string manipulation
features. Perl, by virtue of being older than PHP and having an extensive
community, has thousands of extensions archived in CPAN, which allow
one to do virtually anything with the language, conveniently. from XML
processing to writing to parallel port devices, CPAN includes
everything. CPAN is the reason Perl continues to be useful to a
large number of developers to date. Although it is not impossible to do
everything described here with PHP and a mixture of other languages, it's
simply more convenient with
Perl.
PHP is extremely good at integration with Web pages and databases. PHP
integrates nicely with static HTML Web pages. That's why it's so
popular and has
相关文档:
PHP基本语法和数据类型:
(1)、PHP基本语法:
1、htm 和 php 混编
2、一个语句以 ; (分号结束)
3、如何定义一个变量,和变量的使用
(2)PHP数据运算类型
四种标量类型:
boolean(布尔型) 理解为真假型
integer(整型)
float(浮点型,也作 ......
PHP条件语句的介绍与应用
1、if 条件语句
if(expr)
echo TRUE
else
echo FALSE
if(expr) {
echo TRUE
}else{
echo FALSE
}
f(expr) {
echo&n ......
<?php
//定义一个数组
$arr = array(0=>"zero", 1=>"one", 2=>"two");
//使用第一种方法对数组进行遍历
foreach ($arr as $value) {
echo "Value: $value; ";
}
echo "<BR>";&nb ......
在php中计算时间差有时候是件麻烦的事!不过只要你掌握了日期时间函数的用法那这些也就变的简单了:
一个简单的例子就是计算借书的天数,这需要php根据每天的日期进行计算,下面就来谈谈实现这种日期计算的几种方法:
(1) 如果有数据库就很容易了!若是MSSQL可以使用触发器!用专门计算日期差的函数datediff()便可 ......