PHP vs Perl

Discussion in 'OT Technology' started by RaginBajin, Sep 17, 2003.

  1. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    I am looking around on the net for some documents about how to interact with mysql. So I am looking and I see a lot of documents about using PHP..

    Now why is php better than perl for developing a DB interactive website? Is it easier?

    Just some thoughts.
     
  2. Rob

    Rob OT Supporter

    Joined:
    Jul 6, 2002
    Messages:
    88,612
    Likes Received:
    36
    Location:
    Atlanta, GA
    I think it is because of ease. I think the PHP language had native support for sql interaction. I think you need a perl module for perl to work with any databases.
     
  3. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    I much prefer PHP. Since it's a lot newer, it has a lot of handy features built-in, including SQL support. I used Perl for years, and didn't start using PHP until this year. However, after writing one page in PHP (and using php.net :bowdown: ) I was converted.
     
  4. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Here's why its a little easier in PHP:

    PHP runs scripts inline typically as a module to the webserver. Perl runs its scripts in CGI mode. PHP can run in CGI mode too, but its not as quick (although a lot more secure).

    Some might say PHP isn't as cryptic as Perl. Perl's specialty is string handling. PHP picks up on a lot of Perl's tricks - not all of them, but PHP makes short work of any string tasks you might have.

    Perl has been around for 10+ years which tells you its a mature language and still very useful. Perl is a great language. But for a lot of web tasks, PHP is a lot easier to deal with.

    Perl does require a DB module plugin for it to mingle with a database, but it ends up being really easy to install. PHP also requires a module, but the MySQL module is included by default with most PHP installs. Well, that was true up to PHP v4.2-ish. Around then, they embedded the MySQL library in PHP so it doesn't need a module. If you're going to use something else besides MySQL, then you'll need a module.

    So in the end, I would say PHP is a lot easier to work with as a language and to work with with a database.
     
  5. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    PHP is based on an old perl module. I find them both useful for certain tasks, but for MySQL interaction, PHP is easier.
     
  6. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,918
    Likes Received:
    10
    Location:
    Los Angeles
    [​IMG]

    :p
    I know Perl and PHP. My preference in PHP, because it is newer, has functions capable of doing what you need to accomplish, example: connecting to databases. PHP can do string handling too, I'd say you can do the same things you can do in Perl in PHP when it comes to that. =/ Infact some of the string functions built into Perl are identical to the ones in PHP. PHP just has more support over development. It supports RAD and Perl does not, really. =/

    Since the structure is a lot like C, it is easier to grasp and anybody can learn it. Perl is a little more cryptic and not as easy, but it's starting to fade out of the picture ever since PHP 4 came out. Now that PHP 5.0 will be out pretty soon, it will take place in RAD in web development. I think eventually people will use PHP over Perl.

    Although PHP can work in an Object Oriented environment, it lacks some of the aspects that make an OOP language an OOP language, like inheritence. In PHP 5.0, Zend is working on creating the Object Oriented structure in PHP which would make PHP and Object Oriented language. However, those who still prefer procedural code can also use procedural code in PHP 5. Kind of like C/C++.

    My two cents anyway.. Php > perl;
     
  7. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,918
    Likes Received:
    10
    Location:
    Los Angeles
    I shouldn't be saying Language, it's a process, rather.
     
  8. Divine Vengeance

    Divine Vengeance New Member

    Joined:
    May 21, 2003
    Messages:
    20,453
    Likes Received:
    0
    I'd have to agree that PHP > Perl, for all the reasons stated above. I also noticed that some most PHP scripts execute faster than Perl/CGI scripts, but maybe it just seems that way because I'm biased :hs:
     
  9. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL

    :werd: Same here. I agree with all above. PHP > Perl for many many reasons..

    It may just be me.. but I feel that Perl is too cumbersome..

    And I love those PHP gals. :bowdown:
     
  10. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    How is Perl too cumbersome?
     
  11. Jericho

    Jericho Active Member

    Joined:
    Oct 21, 2002
    Messages:
    34,140
    Likes Received:
    0
    what I don't like about Perl is it's "more than one way to do it" philosophy. It makes script maintenance very very hard, that and it's fucking ugly syntax.
     
  12. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,918
    Likes Received:
    10
    Location:
    Los Angeles
    Haha.. True that man. :p It has horrible looking syntax, haha.
     

Share This Page