Don't ask to ask, just ask | |
PerlMonks |
Re: Compare Perl vs PHPby gnat (Beadle) |
on Jul 07, 2000 at 07:30 UTC ( [id://21400]=note: print w/replies, xml ) | Need Help?? |
My experience backs up that of the other responders.
I love Perl. It's a great language to learn and know.
It's fun, and there are great people behind it. Many
of them here. Perl will be a more useful language for you to learn in the long run. However, it's bigger and more complex than PHP. PHP is pretty strongly tied to web pages, whereas Perl can make GUI applications, text-based console applications, and more. This might mean that learning PHP will give you a quicker reward if your ultimate goal is to make web pages. PHP is a language I use to get a particular kind of job done. That job is integrating databases with web pages. It's very easy to whip up fancy-looking database-backed web pages with PHP because PHP can be embedded in HTML pages and is interpreted in such a way that many common database tasks become very easy. However, as soon as you start wanting to process the data before displaying it, or accessing the filesystem, or running other programs and parsing their output, or sending mail, or ... you're getting into the parts of PHP that aren't its "core strengths" (to put it nicely). At that point I switch to Perl. There are Perl systems like HTML::Mason, Template, and EmbPerl that let you mix Perl and HTML in the same page. These all require more setup than simply "compile in mod_php", but can be worth the effort of learning how to configure them. They let you avoid PHP. However, there's no real reason to avoid PHP. It's a fallacy that everything has to be done in one language and one language only. If it's easy to do some things in PHP and to use mod_perl for others, then do what's easiest and what makes sense. So, my advice: learn both. Which first? Probably PHP because the learnsomething-useit feedback loop is smaller. But do keep your goal of learning Perl in mind, as it'll be far more useful to you in the long run. Nat
In Section
Seekers of Perl Wisdom
|
|