Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to hear some monks' thoughts on PHP and PHP vs. Perl for doing web stuff. I'm at the beginning stage of both and php is coming much easier; if you think I should ditch it and concentrate on perl, let me know why. gracias

Replies are listed 'Best First'.
Re: php?
by neshura (Chaplain) on Feb 17, 2000 at 02:17 UTC
    I have to agree with the Anonymous Monk. The functions are outstanding, the regex ability is great in v4, and it's got a pretty steady learning curve (well, as far as I've gotten with it). The reason I don't use it more is that there is very little call for it in any of my jobs. Also, you just can't beat CPAN. Don't ditch perl, because there are too many applications and sites that use it. Don't ditch PHP either, because there are too many sites that ought to be using it but aren't, and you might make a good evangelist for it. (Especially if you ever have to deal with sites that use stupid proprietary stuff that make you wanna tear your hair out every couple of weeks. But monks aren't supposed to have hair, right?)

    e-mail neshura

RE: php?
by Anonymous Monk on Feb 17, 2000 at 07:40 UTC
    I started out as a Perl programmer and recently I have picked up PHP and I have formed pretty clear notions of when to use what. For server-side scripting, I am a Perl snob through and through. In my opinion, there is no better language for doing complex (or even simple) server-side applications. However, when I want to write web applications, PHP is my choice. It's just as powerful as Perl, the syntax is similar, and it's embedded nature means that I can create complex web interfaces very quickly. It's nice to embed the language into HTML instead of having to output HTML from the language... and PHP's built-in form parsing is lovely. Basically, I say: PHP in the browser; Perl on the server. A powerful combination and all I need to do really cool things ;-)
Re: php?
by Anonymous Monk on Feb 24, 2000 at 11:10 UTC
    I have not yet tried to learn PHP, although I have learned lots of good things about it. I am just starting out with Perl, but learning my way around pretty quickly. Based on what I think I know about what I am going to be able to do with Perl in terms of generating truckloads of dynamic pages once I get my library of HTML tags (and maybe a Javascript library too) going, I gotta wonder why anyone would want to start creating standalone web pages (that would have to be updated individually) if there were an alternative (i.e. dynamicaly generated pages with Perl)? Just my two cents.
RE: php?
by Anonymous Monk on Feb 17, 2000 at 02:07 UTC
    I like PHP. For Web development, it's still one of the best things out there. The language itself reminds me of Perl, Lisp and C (in that order), while managing to retain an identity. It's also more aesthetically pleasing in the traditional way (whereas Perl's beauty is... shall we say... hidden from the unappreciative eye); my habit of writing all code in the FORM:(...)endFORM; syntax gives it just enough of a Pascal-ish tinge to it that it's symmetrical and pleasing, but not as BDSM as Pascal. And of course, the huge integrated library of functions is great for Web developers... especially creative ones. My only real quibble with it is its object model, which is completely unsatisfactory; then again, if I wanted objects, I should go use Zope, right? All in all, PHP is an excellent system, very well suited for the purpose for which it was created. That's all I have to say.
Re: php?
by frankus (Priest) on Apr 24, 2001 at 13:52 UTC
    My first thought on PHP is: not here! , go here or here.

    As for a PHP vs Perl discussion: what for? Regardless of which is better or worse (which are arbitrary values), the question should be 'what do I need to do?'. My philostophy is this: The right tools for the job. Without, knowing this how can we make an informed decision?

    Perl can do pretty much everything, due to it's generic can do-ness, it loses out to languages tailor made for a job. PHP is great for CGI but that is it's remit, the database manipulation and such are adequate.

    If you want one interface for the entire world of computing, Perl is a great choice, and after a little epithany or two, Perl is easy to understand and traditional C formats look a little elementary and perhaps misguided.

    --
    
    Brother Frankus.
Re: php?
by Mr. Lee (Scribe) on Jan 22, 2005 at 22:09 UTC
    Perl is better, but my host has only php. This is parsing me off!
Re: php?
by Tetramin (Sexton) on Oct 17, 2001 at 14:23 UTC
    If for web programming only then PHP is much better integrated in your website.
    But since perl is so powerful you can integrate it into your web page, too. Check out PerlSP for a more php like perl. Just create a web page with .sp extension and add you code between <? ?> like tags. For most web related things it has autoloaded functions instead of manually loaded/coded modules and objects which we usually have in perl. Many functions are borrowed from php.