Re: PHP vs. Perl



They both make some things easy while others are more cumbersome.  Here are some articles:

http://www.oreillynet.com/pub/wlg/5448
http://www.serverwatch.com/tutorials/article.php/10825_1126681_3

In my own experience:
* php is really easy to use. I think, if you are used to programming in C/C++, it is a snap to pick up.
* I really like PERL, but I am very used to HTML/XML "coding" so I like the way that I can verify xHTML with embedded php to make sure that my output will be clean.
* It also appears that the access of databases is REALLY easy with PHP.
* PHP is like modular HTML/XML programming. You can import blocks of content to make pages modular; each of these blocks can be validated (clean) then put together to make pages, like legos. I think that makes it easier to maintain a site, once the look and feel are designed.
* If you build sites for people, many web hosts offer php access; I cannot say the same for PERL (in my limited experience, of course).


But that is just me. I think it depends on the application and what you already know. If you find one is more intuitive syntax, makes smaller code for your typical tasks, or has some feature (like elegance, as in my example of making cleaner HTML code for verification) then use it.

But, if you had a gun to your head and had to pick ONLY 1 of the languages, then learn PERL. It is a more universally useful language for processing, because:
* it is not designed primarily for web development
* it can be compiled into a standalone executable, if you want to distribute it to others who do not have an interpreter (if you get a tool like perlapp or perl2exe, unless you are on a Limux box, in which case you can distill it to C code and probably get that to compile on gcc)
* There are LOTS of perl packages for doing cool stuff, even AI (Fuzzy logic and neural networks) and things like gene sequencing toolkits.



But you probably don't have a gun to your head, so think about what you will be doing more of, then choose which will save you time (since time=money). Just my opinion.



info wrote:

What are the advantages of PHP to Perl or vice versa?  I'm learning a
little of both and want to know which one is better to study in depth.

Thanks.
.



Relevant Pages

  • Re: com_dotnet
    ... And if MySQL isn't installed, the DLL won't load and phpinfowill show MySQL support isn't enabled. ... The MySQL interface is NOT compiled into PHP on the distributed Windows binaries - or you'd never be able to run PHP unless you had MySQL installed. ... *SOME* extensions are protocols, some are functional resources, and some are just type libraries. ... If you're going to compile the extension into PHP itself, the libraries must be available at compile time, and when you run PHP, or PHP won't load. ...
    (comp.lang.php)
  • Re: upgrage from 4.1.2 to 4.3.3+?
    ... > every available RPM for the distro...and there isn't one for PHP. ... > And also, I uh, don't believe I've ever recompiled Apache or PHP. ... Well - You could compile your own version of Apache and PHP and place it ... port number - By this I mean, whenever you visit a website, it defaults ...
    (comp.lang.php)
  • Re: HOWTO: FreeTDS for Newbies (almost complete)
    ... it still wouldn't compile properly. ... cool -- PHP provides 3 ways to load extensions dynamically. ... So I tried changing the comma "," in $server to a colon ":". ... learning how to compile Apache with all the proper modules enabled ...
    (comp.lang.php)
  • Re: HOWTO: FreeTDS for Newbies (almost complete)
    ... it still wouldn't compile properly. ... >above inside php.ini, or to use dlto the top of your php ... >learning how to compile Apache with all the proper modules enabled ... >* Or I'll need a .so that someone has made for PHP that enables SQL ...
    (comp.lang.php)
  • Re: php compile options
    ... On Friday 09 September 2005 11:13, the author Kevin Kinsey contributed to the ... Re: php compile options: ... When php5 is compiled from ports I understand a file is generated to ... Options expressed on the command line for php are normally in lower ...
    (freebsd-questions)