|Keep It Simple, Stupid|
Re: Perl/CGI Vs PHP Vs ASPby weierophinney (Pilgrim)
|on May 22, 2005 at 02:53 UTC||Need Help??|
As you can probably already tell, this request has the potential for starting a flame war... except that you asked it on a perl forum, where you're not too likely to get a lot of dissent. :-)
I use PHP and perl daily. The websites where I work are run on PHP, and the decision to do so was made before I ever started working there. Now that I've been using PHP regularly, I find I like the convenience of access to various CGI interfaces -- the GET and POST hashes, sessions, cookies, headers, etc. Since it was designed with the web in mind, it's all easy.
I still like perl, and have it running my own website. With mod_perl, perl is incredibly fast in a web environment and your objects stay resident in memory, giving some incredible flexibility. You just have to put a little more work into it to get things working correctly together.
Surprisingly, I find myself using PHP increasingly for anything database related because I know already that the database functionality I need is already compiled into the language, and because PEAR::DB is so dang easy to use. This means I use PHP for both web applications and CLI scripting. It works fine in both environments.
I find myself using perl primarily for processing text or when I need to run processes in parallel. Perl makes forking incredibly easy, and with tools like Parallel::ForkManager, it's even easier. As for processing text, well, that's what perl's best at, as far as I'm concerned. The regex engine is so great that many other languages borrow it for themselves (PHP's pcre functions, for instance).
What it comes down to is, what do you know already? You say you're 'decently familiar with Perl,' but in the same paragraph say you haven't done web or database programming using perl -- and the project you outline will have a lot to do with each. I personally feel that at this point you simply have to decide what language you want to learn most -- and then go to it full-bore.
Additionally, you mention you'll be doing a shopping cart. This is not a light project to tackle. Make sure you do a lot of research before getting too involved. Do not store credit card numbers in your database, at any cost -- simply pass them on to a processing agency. You can not afford the liability, period.
P.S. My personal preference when developing a new site, now that I've been using PHP regularly, is PHP. It's what it was designed for, and I find it's easy to just get things done for web-related work when using that language. You have to jump through too many hoops when using perl, even when using standard modules like CGI, to do the simple things like tracking sessions and getting the page parameters. And I'm lazy. :-)