SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Are you using Perl while you could be using PHP?

  1. #1
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    810
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Are you using Perl while you could be using PHP?

    Are there any of you using Perl scripts while you could be using a PHP script? I've had it with Perl. Way too much trouble man! First that chmoding business the whole time. And then if there is a problem you won't know what wrong!

    I have a site that provides free form processors for webmasters. I'm going to dump the Perl scripts and use only PHP scripts from now on. Any one see a possible problem with this? Can Perl scripts do something that PHP script can't?
    Ballot-Box.net - free polls for webmasters
    Ravelly.com - free message board
    FormLog.com - free form processor

  2. #2
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're more comfortable with PHP, thats fine, use PHP. For form processing PHP and perl are probably equivalent, so I can't see how it matters either way.

  3. #3
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    810
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by KevinR View Post
    If you're more comfortable with PHP, thats fine, use PHP. For form processing PHP and perl are probably equivalent, so I can't see how it matters either way.
    Are there any situation in where using Perl is better than using PHP?
    Ballot-Box.net - free polls for webmasters
    Ravelly.com - free message board
    FormLog.com - free form processor

  4. #4
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There might be, but not that I am aware of.

  5. #5
    SitePoint Addict mr cgi guy's Avatar
    Join Date
    Mar 2003
    Location
    Aurora, IL
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DeNasio View Post
    Are there any situation in where using Perl is better than using PHP?
    from a programmer standpoint, yes. from an end users standpoint, not really.

  6. #6
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DeNasio View Post
    Are there any situation in where using Perl is better than using PHP?
    In most cases it doesn't matter, it's more a matter of preference. Perl does have a much wider variety of non-web libraries you can use. If you application required you to do something that's not typical for a web application, perl could be your only choice.

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DeNasio View Post
    Are there any situation in where using Perl is better than using PHP?
    • Perl has CPAN, a stupendous repository of goodies.
    • If you use mod_perl, you can get access to Apache's internals, which allows you to write Apache modules without having to write C.
    • Although PHP is extending itself beyond being web only, Perl isn't web-centric, which is ideal if you need to integrate your web app with a non-web environment.
    • To add new features (say a driver to another database), you just install them. With PHP you often need to recompile the language and include the features. (support for curl, MySQL etc)


    There are also cases where I believe PHP is better:

    • To install an app you often only have to upload it to the server.
    • Perl's support for web services, especially SOAP, is severely deficient (no decent support for consuming services via their WSDLs for instance). In the old days, Perl's SOAP support was ahead of the pack. Now it's sadly lacking.


    But with respect to actually coding for each language, use whichever suits your temperament.

  8. #8
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Location
    Toledo City
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    given budgetary constraint - diskspace, access to CPU - there is no way i could have built my site with PHP. i suppose performance-wise Perl and PHP would be equal if your hardware resources are unlimited. but they usually aren't.

    this is such an old argument. it's like we're discussing ford vs chevy, when these days the real issue is toyota (with which i mean ruby).

  9. #9
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    An Clár, Éire
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DeNasio View Post
    Are there any of you using Perl scripts while you could be using a PHP script? I've had it with Perl. Way too much trouble man! First that chmoding business the whole time. And then if there is a problem you won't know what wrong!
    "that chmoding business the whole time" - what's so difficult about:
    Code:
    chmod 755 *.pl
    If the read and execute bits are set for whatever user Apache is running as, you're grand.

    As for not knowing what's wrong: if you set up your script to tell you what's wrong, you'll find out easily enough Turn on strict and warnings, use CGI::Carp to send fatal errors to the browser (or just open a filehandle so STDERR prints to a file). And of course using "perl -c" to at least make sure your script compiles before trying to run it in a browser.

    It sounds to me like you didn't spend a lot of time trying to get over the initial difficulties you experienced with Perl.

    Quote Originally Posted by DeNasio
    Are there any situation in where using Perl is better than using PHP?
    Yes. If you want to use arrays. Or if you're not clairvoyant and you want to be able to write functions that won't be broken by future versions of the language. And there's CPAN.

  10. #10
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perl is better IMO...been around longer, has a much larger library and in my tests it's always faster(maybe because I optimize for Perl). PHP is great for quick projects but a serious project I always use Perl. I've started to use a framework(Catalyst) and boy does that make a world of different. Websites work seamlessly and flow perfect...it takes a little longer to get setup but it's way more powerful than PHP.

    Oh, and one thing I don't like about PHP is they allow(and promote) poor programming. I've seem some scripts written in PHP that were horrendous and if programed in Perl they would be a lot safer and quicker. PHP is one of those languages anyone can pick up quickly(great) but it leads to really crappy code, at least with Perl you turn in strict and warnings and you are held to some standard. GLOBAL variables = crap.

  11. #11
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    An Clár, Éire
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by detzX View Post
    Oh, and one thing I don't like about PHP is they allow(and promote) poor programming. I've seem some scripts written in PHP that were horrendous and if programed in Perl they would be a lot safer and quicker. PHP is one of those languages anyone can pick up quickly(great) but it leads to really crappy code, at least with Perl you turn in strict and warnings and you are held to some standard. GLOBAL variables = crap.
    Thankfully the PHP folks saw sense and eventually disabled register_globals by default. That aside, it's easy to write horrible, insecure code in *any* language. I'm a huge fan of Perl (and have no love for PHP) but I've seen my fair share of crappy Perl code too. I blame the programmers, not the language.

  12. #12
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ishnid View Post
    Thankfully the PHP folks saw sense and eventually disabled register_globals by default. That aside, it's easy to write horrible, insecure code in *any* language. I'm a huge fan of Perl (and have no love for PHP) but I've seen my fair share of crappy Perl code too. I blame the programmers, not the language.
    True but PHP makes it very easy to write crappy code so there is a lot more of it.

Bookmarks

Posting Permissions

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