IT Community - Software Programming, Web Development and Technical Support

Main Diffrence Between Perl with Php?

This is a discussion on Main Diffrence Between Perl with Php? within the PHP Programming forums, part of the Web Development category; I have read posts here in the topic " how to use perl in PHP" very nice question. As ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-10-2007, 07:24 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Main Diffrence Between Perl with Php?

I have read posts here in the topic " how to use perl in PHP" very nice question. As i am new to Perl and PHP, i want to ask small question.

can anyone tell me some main diffrence between those?

Last edited by senraj : 08-10-2007 at 07:35 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-10-2007, 10:32 PM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: Main Diffrence Between Perl with Php?

PHP

PHP uses a blend of interpretation and compilation in order to provide the best mix of performance and flexibility to programmers.

Behind the scenes, PHP compiles your script down to a series of instructions (called opcodes) whenever it is accessed. These instructions are then executed one by one until the script terminates. This is different from conventional compiled languages such as C++ where the code is compiled down to native executable code then that executable is run from then on. Instead, PHP re-compiles your script each time it is requested.

This constant recompilation may seem a waste of processor time, but it is actually not all that bad because you no longer need to worry about hand recompiling your scripts when you make any changes. On the flip side, many scripts take longer to compile than they do to execute!

Furthermore, it provides very quick feedback during development. If you have an error somewhere in your file, PHP will refuse to compile the page until you have fixed the problem, and you are able to step through execution of your code line by line until you find the problem.

The speed hit of regular compilation is nullified entirely by the use of PHP accelerators.

One major advantage to having interpreted code is that all memory used by the script is managed by PHP, and the language automatically cleans up after every script has finished. This means that you do not need to worry about closing database links, freeing memory assigned to images, and so on, because PHP will do it for you. That is not to say you should be lazy and make PHP do all the work - good programmers clean up themselves, and let PHP work as backup in case something is missed.

Perl

Perl is the most popular of the PHP alternatives out there, arguably because it is also the oldest. There is a large installed base of Perl out there; many open-source projects require Perl to be installed to work properly. It has the advantages of being very (very!) flexible, and also having a large collection of modules already written for it. However, it is let down by the fact that it is very easy to write obfuscated and confusing Perl without really realising you are doing so, and this has resulted in such marvels as the annual Obfuscated Perl Contest.

Well-written Perl scripts often look fairly like their PHP equivalent. The major cause for Perl's messy appearance is that many Perl programmers rely on "one-liners" - packing large amounts of functionality into just one line of code. Perl was once described very accurately by its creator, Larry Wall, when he argued that the front cover for his O'Reilly book on Perl should be a camel, saying that Perl was ugly but serviceable, and able to go long distances without much nourishment.

Perl is often a better choice when you want to take advantage of some of the pre-written libraries. CPAN, Perl's library repository, is very big, and there is a huge range of code for you to take, customise, and re-use. Perl also has a very active - and very cool - hacker community around it that's a whole lot of fun to be part of and is really a bedrock of support when you need it. Larry Wall and Damian Conway (both core Perl developers) are both rightfully revered as "alpha geeks" - people who really push the envelope of programming by doing cool new things. They are both very friendly, and and attend many conferences year round - go ahead and introduce yourself if you meet them, because they really are fascinating to talk to.

thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-11-2007, 07:24 AM
venkat_charya venkat_charya is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 118
venkat_charya is on a distinguished road
Thumbs up Re: Main Diffrence Between Perl with Php?

As per my personal experince i found one very important and major difference between perl and php.

In PHP while you post XML and if that XML have & or ? sign then that xml reach as array in destination of one string.

But this thing handle by PERL and it received whole XML value as string.

I used that logic in my problem and it worked well.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Main method vigneshgets C# Programming 2 08-16-2007 10:06 PM
What are the main attributes if test automation? devarajan.v Software Testing 2 07-27-2007 06:30 AM
What are the main phases of QTP? itbarota Testing Tools 2 07-24-2007 03:04 AM
How to set Perl Interpreter within perl script sivaramakrishnan Perl 1 07-19-2007 05:45 AM
diffrence between and constraints and triggers sivakumar Database Support 1 07-12-2007 03:00 AM


All times are GMT -7. The time now is 09:18 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0