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¡¢if Ìõ¼þÓï¾ä
if(expr)
echo TRUE
else
echo FALSE
if(expr) {
echo TRUE
}else{
echo FALSE
}
f(expr) {
echo&n ......
PHPÊÇʹÓÃ×îΪ¹ã·ºµÄ¿ªÔ´·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÖ®Ò»£¬µ±È»PHP²¢
²»ÊÇËÙ¶È×î¿ì
µÄ£¬µ«ËüÈ´ÊÇ
×î³£ÓõĽű¾ÓïÑÔ
¡£ÕâÀïÓÐ50¸öÓÐÒæµÄPHP¹¤¾ß£¬¿ÉÒÔ´ó´óÌá¸ßÄãµÄ±à³Ì¹¤×÷£º
µ÷ÊÔ¹¤¾ß
Webgrind
Xdebug
Gubed PHP Debugger
DBG
PHP_Debug
PHP_Dyn
MacGDBp
²âÊÔºÍÓÅ»¯¹¤¾ß
PHPUnit
SimpleTest
......
PHPÑ»·Óï¾äµÄ½éÉÜÓëÓ¦ÓÃ
1¡¢break n Ñ»·¿ØÖÆÓï¾ä
Break Ìø³öÒ»²ã£¨±¾´Î£©Ñ»·;break n Ìø³ön²ãÑ»·;
2.Continue:continue ÔÚÑ»·½á¹¹ÓÃÓÃÀ´Ìø¹ý±¾´ÎÑ»·ÖÐÊ£ÓàµÄ´úÂë²¢ÔÚÌõ¼þÇóÖµÎªÕæÊ±¿ªÊ¼Ö´ÐÐÏÂÒ»´ÎÑ»·¡£×¢:×¢ÒâÔÚ PHP ÖÐ switch Óï¾ä±»ÈÏΪÊÇ¿ÉÒÔʹÓà con ......