Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Comparison Between PHP and Perl

posted by pudge on 2000.04.17 13:45   Printer-friendly
Giorgio Valoti writes "Hi all, I was asked to make a comparison between PHP and Perl based solutions for dinamic web sites and/or web apps. I appreciate the power, flexibility and portability of Perl, but what about PHP? Has someone of you tried these solutions and doesn't mind to share the pros and cons? "
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • PERL vs PHP (Score:1, Interesting)

    In my experience for building web applications PHP is the way to go. It's been designed since the beginning to be a web programming language. It has all the features I need, it's fast, and it's stable. From my experience with mod_perl it's been slow and it seems to leak memory. I don't if they've fixed this yet though. Don't get me wrong I think that perl is great, I just also think that each language has it's place and in my opinion PHP is better for web stuff.
  • Re:PERL vs PHP (Score:1, Interesting)

    I've never seen any good evidence that mod_perl is slow in comparison to PHP. Do you have any?
  • Re:PERL vs PHP (Score:1, Interesting)

    I too would like to see some timing characteristics of mod_perl vs PHP. A good test would be programs that do the following:

    • Nothing (The empty program)
    • Only loops
    • build a small array
    • build a large array
    • build a small hash
    • build a large hash
    • reads a file and writes a web page
    • ... (you get the idea)
    • some arbitrarily complex operation

    (Keep in mind that I don't know or use PHP; but if anyone has some good data that could change ;-)

    I'd be interested in memory consumption as well as timing if anyone is

  • Re:PERL vs PHP (Score:1, Interesting)

    Memory leaks were pretty much eradicated in 5.4. That's what made mod_perl workable in the first place.

    On the other hand, mod_perl requires some tricks to minimize total memory usage. But those tricks are well-known and documented by now.

  • PHP vs Perl (Score:1, Interesting)

    I am using both in the intranet/extranet project I am contracting on. PHP has some nice features wrt embedding code in HTML. I've never used any embedded perl, so I can't comment on that. PHP's syntax is sometimes maddeningly close, but not close enough to perl that it drives me batty. It also has the annoying property of explicit function calls for everything. I would love to have the simplicity of $x =~ s/foo/bar/g; as opposed to preg_replace();

    On another hand, it does a nice job with HTTP handling. Form

  • > PHP has some nice features wrt embedding code in HTML.

    This is actually one of the things I don't like about PHP and other, similar tools like ColdFusion. I used Cold Fusion for years and have evaluated PHP as a replacement. Embedding code in the HTML gets messy fast. For smallish applications it's not too bad, but if you have to do complex or large applications, trying to work around the HTML get's frustrating.

    I prefer to keep the code and the content as separate as possible.

  • Re:PHP vs Perl (Score:1, Interesting)

    Embedding code in the HTML gets messy fast.

    Agreed. But for quick forms processing, canned queries, and prototyping it works well. Rigorous adherence to coding style standards helps a great deal. (which is true for any other programming venture)

    I prefer to keep the code and the content as separate as possible.

    As do I. Templates and fully dynamic, database-driven sites are the things I am starting to focus my attention on.

  • An even better tool for forms and simple database work is BRL [], which I wrote. The syntax is not maddeningly close to perl; it's based on Scheme. Database access is extremely concise and database-independent.