Results 1 to 7 of 7

Thread: Perl or PHP?

  1. #1
    Join Date
    Jun 2008
    Location
    Dublin, Ireland
    Posts
    298

    Default Perl or PHP?

    Hello OpenSuse People,

    I am about to undertake developing a web based application using Linux, Apache, MySQL or Oracle Express and finally Perl or PHP. I would favour Perl since I know that language best but I don't know how to implement it in a 'modern' web context. I have used it in CGI scripts on Intranet web sites and it works very well. I don't think CGI scales up well as far as I know. It creates a separate process on the machine every time a new request comes in which (depending on the popularity of the site) would result in the server getting clogged with processes. Perhaps that's not as important nowadays with more powerful servers. I would like to know if there is any other way to implement Perl other than CGI, or what do people use now? Is it all PHP? I had a look at some PHP and it looked very like Perl. Perl has an absolutely massive amount of libraries.

    I don't know.. Any advice welcome..

    /jlar

  2. #2
    ab@novell.com NNTP User

    Default Re: Perl or PHP?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Personally I love and use Perl almost exclusively for a million things
    at an OS level, but PHP is really easy and has everything you probably
    will ever need for the web and is made for that purpose. Especially
    with suse, adding various new modules of PHP (MySQL, Oracle,
    image-manipulation, flash generation, etc.) support is just a quick
    install through Yast and a restart of (highly preferably) Apache. If
    you know Perl then PHP will be a quick language to learn. More c-style
    than Perl is but it's all fairly close.

    Good luck.





    eeijlar wrote:
    | Hello OpenSuse People,
    |
    | I am about to undertake developing a web based application using Linux,
    | Apache, MySQL or Oracle Express and finally Perl or PHP. I would favour
    | Perl since I know that language best but I don't know how to implement
    | it in a 'modern' web context. I have used it in CGI scripts on Intranet
    | web sites and it works very well. I don't think CGI scales up well as
    | far as I know. It creates a separate process on the machine every time
    | a new request comes in which (depending on the popularity of the site)
    | would result in the server getting clogged with processes. Perhaps
    | that's not as important nowadays with more powerful servers. I would
    | like to know if there is any other way to implement Perl other than
    | CGI, or what do people use now? Is it all PHP? I had a look at some PHP
    | and it looked very like Perl. Perl has an absolutely massive amount of
    | libraries.
    |
    | I don't know.. Any advice welcome..
    |
    | /jlar
    |
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIY6rM3s42bA80+9kRAo/dAJ9NwYdobYWY5QRAJxxlxmY5OYEHHACbB1cZ
    412eYXJPrV7gopGofVHa4So=
    =t4Mc
    -----END PGP SIGNATURE-----

  3. #3
    Join Date
    Jun 2008
    Location
    Dublin, Ireland
    Posts
    298

    Default Re: Perl or PHP?

    Thanks! I think I will buy one of those PHP/MySQL books and give it a shot...

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Perl or PHP?

    Perl is more suited to admin or data munging tasks, but where web servers are concerned, PHP has the edge because

    The PHP is usually loaded as an Apache module and thus support is "inside" the web server, instead of using CGI scripts which cost a process invocation per page view. Sure there is a mod_perl also but it is less worked on than mod_php5.

    There are many more libraries and frameworks for PHP programming for web pages than for Perl.

    You may experience some frustration with PHP, because it's obvious that it has copied many ideas from Perl but not implemented them as elegantly or powerfully as in Perl. For example, regexps are handled by library routines and the language has no intrinsic regexp type or operators.

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,488

    Default Re: Perl or PHP?

    Quote Originally Posted by eeijlar View Post
    Thanks! I think I will buy one of those PHP/MySQL books and give it a shot...
    All docs are online:
    MySQL :: MySQL 5.0 Reference Manual
    PHP: PHP Manual - Manual
    Henk van Velden

  6. #6
    Join Date
    Jun 2008
    Location
    Albuquerque, NM, USA
    Posts
    87

    Default Re: Perl or PHP?

    Why not python?
    It's really that much fun!
    Geeko Samurai (cc)
    My Recent Tracks

  7. #7
    Kevin Nathan NNTP User

    Default Re: Perl or PHP?

    On Thu, 26 Jun 2008 13:56:04 GMT
    eeijlar <eeijlar@no-mx.forums.opensuse.org> wrote:

    >I am about to undertake developing a web based application using Linux,
    >Apache, MySQL or Oracle Express and finally Perl or PHP. I would favour
    >Perl since I know that language best but I don't know how to implement
    >it in a 'modern' web context.


    Perl with the Catalyst Framework and Template Toolkit. See:

    http://www.catalystframework.org/
    http://template-toolkit.org/

    and seriously consider buying Jonathan Rockway's book (seen on that
    page as well). Then consider the FastCGI plugin and mod_fastcgi (or
    mod_fcgid). You will be amazed at how easy web programming is with
    these tools.


    --
    Kevin Nathan (Arizona, USA)
    Linux is not a destination, it's a journey -- enjoy the trip!

    Linux 2.6.22.18-0.2-default
    10:58pm up 2 days 1:15, 21 users, load average: 1.42, 1.01, 0.98


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •