in reply to perl or php?
Every now and then, we get a question like this at the Monastery. Since this is the Perl Monastery, you can generally expect an answer supporting Perl. Perl 6 is little far off to talk about its utility to you, so I'll stick to PHP 4 and Perl 5.
Often when PHP people talk about Perl, they refer to using it with the CGI. CGI is, well, a bit old. It might do what you want, but it turns out that PHP beats Perl via CGI hands down because PHP is actually mod_php and built directly into your Apache web server. Nowadays, people interested in speed tend to use mod_perl instead of CGI (although there are alternatives to mod_perl as well). This comparison turns out to be much fairer. Actually, mod_perl combinaed with something like Mason turns out to be very fast. There is an entire book out on how to use mod_perl.
In our project, we use PHP because someone got advice like yours. The ironic thing is, we use Perl for absolutely everything else. You see, PHP is limited to being served up via HTTP, whereas Perl can be used to munge data, help you with system administration, build spiders or complex web scraping applications.
What it comes down to is this: PHP was modeled on Perl and is still a subset of Perl. Sure, there are web-specific functions built in to PHP, but I have yet to find a PHP function that cannot be found in the core Perl distribution or in a module off of CPAN.
Update: batkins pointed out a muddle. I meant something like "traditional CGI" up there---the one that would even produce output from a shell script. I thought it was clear from the context, but it deserves clarification.
Update of update: Looks like I was a little too quick to acknowledge someone else knows things better than I do. It turns out that my memory did serve me well. Thanks to revdiablo for looking up the facts.
--
Allolex
Perl and Linguistics
http://www.wall.org/~larry/keynote/keynote.html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perl or php?
by jacques (Priest) on Nov 23, 2003 at 17:15 UTC | |
by batkins (Chaplain) on Nov 23, 2003 at 17:33 UTC | |
by jacques (Priest) on Nov 23, 2003 at 17:49 UTC | |
|
Re: Re: perl or php?
by batkins (Chaplain) on Nov 23, 2003 at 15:06 UTC | |
by revdiablo (Prior) on Nov 23, 2003 at 22:16 UTC | |
|
Re: Re: perl or php?
by BUU (Prior) on Nov 23, 2003 at 15:38 UTC |