Results 1 to 19 of 19

Thread: Perl or PHP?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Toronto, Canada
    Posts
    52

    Perl or PHP?

    Hi,

    I bet you heard this a lotta times, but how do you think Perl and PHP stand up against each other? I know Perl but I wanna learn PHP (since everyone's talking about it!). So which one is better?

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Perl is better for conversions and net spiders. Also it's got a boatload of free customized software (in the form of .pm's)allowing you to interface with all kinds of goodies.

    PHP is more suited to building web pages because you can easily switch between PHP and HTML right in the code. This can be done in Perl, but it's not as elegant. Also PHP has a built in feature of session variables that help you maintain a persistent connection to your web surfers when the browse from one page to the next. With Perl, you have to manually maintain the connection with cookies or maintain the session in a file or database.

    Professionally speaking, Perl, PHP and ASP all share this drawback: if you sell your code, your buyers automatically have access to your source code. Java Servlets and C, on the other hand, are compiled which means you, the author, have more control over what can be done with your software.

    cudabean

  3. #3
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by Cudabean
    Professionally speaking, Perl, PHP and ASP all share this drawback: if you sell your code, your buyers automatically have access to your source code. Java Servlets and C, on the other hand, are compiled which means you, the author, have more control over what can be done with your software.
    With my hosting package comes an admin control panel-esque thing, which is a .cgi file, but it's encrypted!

    It seems to get passed to a decrypter, then to Perl, but i've no idea how to use the Filter module. If anybody knows I'd be very greatful. This is a little bit of it
    #!/usr/bin/perl
    use Filter::decrypt2 ;
    ÿ a8HS<
    "1a|Ss8HS 
    5S5!AT2^
     Y?#8("E laPL*?S/S[X H
     CY%%a|HaPL7 {DG'@OKA`OS3+CAX6FL <$"MW0]S3ybGUWU'VK 9S1/G@F-@S5ybGY\G'VK
    ?
    a>F\E'QO
    p5+^P,S sLp3S""]V_6
    O=$"G^b@  O3a;F_0W
    
    Y ?S'+UGD0WK Zy4=Qr{QI/ OxW :U_B])r\HHmGY+AKY )U.<GT1F Y   $=>FB'8  jO )/FVUy;bzO
    Last edited by chrisjk; Jan 8th, 2002 at 06:03 AM.

  4. #4
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    Perl seems to be slowly dying off, and being replaced with PHP. But I think PHP and ASP, will remain togethor for a long time, like VB and C++

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by Gimlin
    Perl seems to be slowly dying off, and being replaced with PHP. But I think PHP and ASP, will remain togethor for a long time, like VB and C++
    yeah i think you could be right, it seems to me that it's just so much easier to do something in PHP than the equivelent in perl

  6. #6
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Perl's not dying - remember there are a million other uses for Perl besides web development. And if you use it for other things anyway, you tend to prefer it over PHP for your development (just like VB programmers would pick VBScript as their ASP language). And you can use Perl for ASP.

    Then again, there's a newer, OO language called Ruby that's said to be a better Perl than Perl...
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  7. #7
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    I thought since this is a web forum that saying "... in the context of web development" was superfluous.

    I'm a solid VB man but because I knew Perl I went for PHP instead of ASP as Perl and PHP are pretty similar, which is certainly a good thing.

    This Ruby sounds interesting, is that likely to be big for web dev?

  8. #8
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    And ASP is only better then PHP when using a huge DB

  9. #9
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I thought since this is a web forum that saying "... in the context of web development" was superfluous.
    Well, XML or Perl aren't limited too web development, and I'd consider any question with them on topic.

    This Ruby sounds interesting, is that likely to be big for web dev?
    I don't know. I'm expecting it to put some serious heat on Perl and Python for *nix scripting language of choice in a couple years. If someone makes Apache mod_ruby I'm sure it'll be.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  10. #10
    scoutt
    Guest
    Originally posted by Gimlin
    And ASP is only better then PHP when using a huge DB
    how is that when MySql can hold 300% more in it's tables than Access.




    The biggest advantage of PHP over Perl is that PHP was designed for scripting for the web where Perl was designed to do a lot more and can because of this get very complicated. The flexibility / complexity of Perl makes it easier to write code that another author / coder has a hard time reading. PHP has a less confusing and stricter format without losing flexibility. PHP is easier to integrate into existing HTML than Perl. PHP has pretty much all the 'good' functionality of Perl: constructs, syntax and so on, without making it as complicated as Perl can be. Perl is a very tried and true language, it's been around since the late eighties, but PHP is maturing very quickly.

  11. #11
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Yeah, but can MySQL support transactions like Access yet?
    The flexibility / complexity of Perl makes it easier to write code that another author / coder has a hard time reading
    That's a feature!
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  12. #12
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    well it is if you intend to sell scipts...

  13. #13
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    In the end the correct answer is to not ask the question, rather learn both because they are both useful for what they do.

    Also, make sure you have C syntax down because it is the basis of so many languages (C++, Java, perl, C#, awk, etc.).

    cudabean

  14. #14
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I best be likin' the perl more because it's more availibility optional in the filestream.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  15. #15
    Member TheGuru's Avatar
    Join Date
    Dec 2001
    Posts
    57
    PHP is faster then perl but php wasn't never really meant to be a langauge.. Its still evolving but will probably put perl to its death sooner or later.

    Java Servlets and C, on the other hand, are compiled which means you, the author, have more control over what can be done with your software.
    Yea but you have to compile the **** on their machine if you cross platforms with it or so I've heard. So either way you end up having to fork over code.. If you could simply compile the **** and sell it compiled then I'd make a zillion c++ scripts.

  16. #16
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    PHP is faster then perl but php wasn't never really meant to be a langauge.. Its still evolving but will probably put perl to its death sooner or later.
    But there is massive amounts of CGI-ish code written in Perl, so I'd expect it to be around for a long time.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  17. #17
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    Originally posted by TheGuru
    Yea but you have to compile the **** on their machine if you cross platforms with it or so I've heard. So either way you end up having to fork over code.. If you could simply compile the **** and sell it compiled then I'd make a zillion c++ scripts. [/B]
    If that's the case, why aren't you writing zillions of Java apps?

    cudabean

  18. #18
    Member TheGuru's Avatar
    Join Date
    Dec 2001
    Posts
    57
    JoshT - Yea perl still has demand but thats cause there is some things you cannot do in php "yet". I think if ya give php some times and let it evolve some more, it'll beat perl. For one reason is because it doesn't have the CGI overhead and its a lot simplier to use in a lot of ways.

    Cudabean - only thing ya ever see java with is when someone is trying to change a homepage, add bookmarks, etc lol. Most online look at java like javascript but with a little umph to it.

  19. #19
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    because it doesn't have the CGI overhead
    This is dependent on web server configuration -- the stable IIS version of PHP is CGI and PHP can be run under Apache as CGI. However, for Apache, you can use mod_perl to run Perl without the CGI overhead, just like PHP runs with mod_php.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width