|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP vs Perl
Hello, excuse me for not understanding this but what is the difference between PHP & Perl?
Reason I am asking is that I am trying to learn about website hosting so I am trying to learn as much as possible about it. Thank you |
|
#2
|
|||
|
|||
|
Perl and PHP are both server side web languages. They process 'server side' to generate client side code (html and javascript. etc)
The main difference is the language structure and function names, etc I dont have too much experience with perl, but as an example to create a working contact form in perl would take up to 400 lines of code. The same in php would be about 50 or less lines of code. Hence why php is more popular then perl at the moment. |
|
#3
|
||||
|
||||
|
IMHO PHP Is also alot easier to script in also.
One advantage of PERL however is that it is compiled the first time it is accessed, and doesn't need to be recreated each time the page is accessed, which reduces some server loads. That is one of the reasons why people tend to like perl. If you're wanting something like that also, you can run PHP as a CGI.. But Ben is right, it is quite a bit easier to write something in PHP as it is to write the same thing in PERL.. My registration script is about 8 lines of inputting data into the database and adding them to the mail server, as opposed to the perl script which is about 60 lines to do the same thing.. |
|
#4
|
|||
|
|||
|
PHP vs Perl
PHP is easier to learn, read and code for Web pages- especially database driven ones. So, if you're just concerned with the Web, stick with PHP.
Perl is more versitle for scripting within the unix environment and integration with 3rd party applications. It's the language of choice for system administrators. |
|
#5
|
|||
|
|||
|
yea.. i know both php and perl...
for my purposes (im a webhead) php is better... and faster with intergration directly into the apache server... perl is an interpreted language by the way, it doesn't get compiled into binaries, usually anyway.. it can be done im told.. as far as your registration/contact form scripts go... i don't know what your talking about... those simple scripts can be done in practically the same amount of code... not in disparing number that you mention. but perl is the system admins choice for a reason... it intergrates very very nicely with *nix... the syntax of both php and perl are very very similar once you get past embedding php in html documents |
|
#6
|
||||
|
||||
|
Quote:
You can compile perl, it runs pretty quickly too.. also it's quite easy to encrypt and protect your code with perl once it is compiled.. As for the syntax, not sure.. don't code in perl myself ![]() |
|
#7
|
|||
|
|||
|
well in terms of scripts, I have found a lot of database problems with php's popular scripts but for the PERL one I havent any many problems. However PHP is far more powerful and there are better scripts out there.
__________________
You don't deserve to read my signature...yeah! That's it, keep walking...yeah walk away from me! That's it! Get out of my pub, you're barred! |
|
#8
|
||||
|
||||
|
Hmm... maybe to really understand the differences between the two, we should also look at the most fundamental purpose of the two languages..
Quote:
Quote:
So... there we go... Perl initially was optimized for extracting information, whereas PHP was designed to solve web development problems. That's the reason why web developers are loving it now. The reason why Perl was used to develop web applications was because at that time, web pages were static. So, programmers started extending the functionality of an HTTP server by writing a utility that ran separately from the web server, but acted as a slave to special processing requests from the server, making web pages more dynamic. And then they found perl to be really effective as a server side programming language. - Sourced from Javaserver Pages Application Development (Forta et al, 2000) Hope that clears up a bit.. if any mistakes on what I said.. please forgive me ![]() |
|
#9
|
|||
|
|||
|
so basically PERL, wasn't meant to be a web development language? But then again wasnt PHP born from Perl:
Quote from my PHP Book: "PHP originally sttor for Personal Home Page and was created in 1994 by an independent i.t. contractor named Rasmus Lerdorf. This was simply a set of Perl scripts he wrote to track visitors to his website..." |
|
#10
|
||||
|
||||
|
PERL is a web application development language... people use it for CGI work, authentication systems... ordering systems.. database work.. as well as a scripting language.. people used PERL and liked it so much because it was easy to write the program to work in both a shell environment as well as the web environment..
|
|
#11
|
|||
|
|||
|
oh right...PERL is cool but PHP is better because there are better scripts out there and resources to learn from, plus PHP will soon fade out when some new language comes in originated from PHP, like PHP was originated from PERL.
|
|
#12
|
||||
|
||||
|
Well.. what I can do in perl in 80 lines I can do in php with only 8, if even that many..
![]() |
|
#13
|
|||
|
|||
|
Vince...
Quote:
That's exactly it... PHP was on its own when it was born... that's the reason why it is disctinct in what it does, although Perl and PHP has some similarity..... but then again... there are similiarities in all programming languages... ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Community > The Lizard Lounge > PHP vs Perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|