in reply to Re^3: The REAL reason for why they choose PHP over Perl.
in thread The REAL reason for why they choose PHP over Perl.

Hmm, I think I hit msg instead of reply, sorry.

I was curious as to what those architectural differences were in an installed system. The difficulty of installing mod_perl and Mason is comparable to a mod_php install, and even easier if you have a packaging system. The only real difference being a split up config file versus a single config, and Mason's caching system. I may be wrong, and there's more, so feel free to enlighten me.

Once it's installed, using Mason is as simple as setting a handler on a file type (which is what one does for PHP), or designating a directory tree as handled by Mason. With the installation being the main difference, most users of the code don't have to worry about it, as very few of the PHP programmers I've come across administer the servers they code on as well.

I will concede that there are definite hurdles to installing a Perl handled scripting system versus PHP, which can use some work. As I stated in my previous post, I had to restrict myself to just playing with Mason, because it didn't have proper mod_perl2 support at the time I wanted to use it. My main point however, was that once installed, it is functinally no different then PHP itself, you are simply using perl instead of php code. And you can additionally toss in extra code blocks for more flexibility with init/argument/etc handlers.
  • Comment on Re^4: The REAL reason for why they choose PHP over Perl.

Replies are listed 'Best First'.
Re^5: The REAL reason for why they choose PHP over Perl.
by exussum0 (Vicar) on Jun 15, 2006 at 15:53 UTC
    You've ignored something I've said. perl is more than just mason. If you wish to do database work, you have DBI and tonnes of DBDs you can install. You have Class::DBI and many other forms of data access. You have modules for PDF, Word. Mason doesn't support it outright, where php directly does.

    In php-land, some large portion "modules" are actually c extension for php.

    In php, you have the mysql_*, postgresql_* and the direct db functions and that's about it. Yes, pear is an abstraction layer, but nothing beyond abstraction has been done yet. perl has various forms of data access as i've stated before.

    In perl, modules go into a namespace with a PERL5LIB path. Most of your code is written IN perl.

    In php, you are limited to includes which don't use a lib path where most of your modules are written in c.

    You can't write a multithreaded php application.

    And there are differences between php and mason post installation. To add modules is completely different between the languages.

    php is a web language first, and a programming language second. perl is a programming language first, and a web technology second. the internals and the language design lead toward this.

    I could go on and on. but please, stop ignoring that this is perl vs php, not mason vs php. Mason is cute, and it mimics php.

      I'm not ignoring anything, what you're calling PHP supporting outright is a compiled in module. It's the same as saying Apache supports mod_perl or mod_php outright. Both perl and php have a process of including files or libraries. PHP's requires forethought and compiling in the server.

      Once it's included, it's just another module, php just dumps it in the main namespace.