Re: Comparison PHP to Perl

From: Al (php.newsgroups_at_allysays.com)
Date: 01/06/04


To: php-general@lists.php.net
Date: Tue, 6 Jan 2004 19:08:55 +1100


"Warren Vail" <warren@vailtech.net> wrote in message
news:03ac01c3d421$a7b879c0$6401a8c0@comcast.net...
> I am looking for a comparison of features supported by PHP vs those
> supported by Perl.
>
[snip]

Ah, this old chestnut.

As someone who wrote a major application in Perl, and now (mostly) uses PHP,
I can only reiterate what's been said a thousand times before: the language
you choose depends on what features you want and the type of script you'll
be writing.

You've only identified session support as a requirement, and although PHP
has native session support, Perl has similar functionality available via the
Apache::Session CPAN module. Actually, this is true for almost all extra
native functionality in PHP that Perl does not support -- it's there in
Perl, but you need to download a CPAN module for it. Another example of this
is PHP's native mail( ) support. (For the uninitiated, CPAN
[http://www.cpan.org] is a fantastic collection of standardised Perl
extensions with an easy install script that has evolved over many years).

Unfortunately the same does not apply for PHP: although it has an impressive
array of built-in functions (especially compared to Perl's paltry offering),
if a particular feature is not handled natively then you'll probably have to
write your own code to implement it. Although there *is* a CPAN equivalent
in PHP called PEAR [http://pear.php.net] that boasts a decent number of
modules (most of which are still in early development stages), PHP simply
hasn't been around long enough attract as much module development as Perl.

So in summary: list all the features you need and if PHP supports them all
(or if a few are missing and PHP's ease-of-use and other benefits outweigh
the cons) then go with PHP, otherwise take another look at Perl. For a list
of PHP's features, take a look at the documentation ... it's very
user-friendly. [http://www.php.net/manual/en/]

You'll also find a ridiculously large number of articles online comparing
PHP to Perl, just do a Google search such as:
[http://www.google.com/search?q=php+perl+comparison]

Hope it helps,

Al



Relevant Pages

  • Re: [PHP] Comparison PHP to Perl
    ... though I'd also say that for things not native to the language ... perl will have a better library of modules available. ... % My gut tells me PHP is more robust, but we are trying to implement something ... % One alternative is mainframe COBOL, which clearly will not support what we ...
    (php.general)
  • Re: What is the learning curve for PHP?
    ... but adds its own features. ... PHP was just a bunch of Perl scripts. ... functions in the script. ...
    (comp.lang.php)
  • Re: Form send me an email
    ... According to their web site they seem to support everything: PHP, JSP*, ... ASP*, & PERL ...
    (microsoft.public.frontpage.client)
  • Re: File::Find - passing argument to &wanted
    ... I know Perl, I've ... used PHP, and they do different things well. ... reasoning Emacs Lisp would be a kiddie language because it has no ... namespaces and many other Perl features. ...
    (comp.lang.perl.misc)
  • Comparison PHP to Perl
    ... supported by Perl. ... My gut tells me PHP is more robust, but we are trying to implement something ... but current management does not want to fight for PHP as a new ... which clearly will not support what we ...
    (php.general)