Gossamer Forum
Home : General : Perl Programming :

Perl/CGI vs PHP or ASP ...??

Quote Reply
Perl/CGI vs PHP or ASP ...??
Working with DBman; I like it.

I've looked at ASP; I don't like it.

I've tried to find info on PHP; no success.

Could someone tell me the main differences between Perl/CGI, PHP and ASP, and why people generating dynamic pages seem to moving away from Perl/CGI ? (...maybe I'm moving in the wrong circles !!)

Where can I get some info on PHP ...?
Quote Reply
Re: Perl/CGI vs PHP or ASP ...?? In reply to
web dog,

You'll find the php site at www.php.net .

I'm not going to go into the intracacies of one against the other, because while I understand the basic differences, I couldn't explain them to save my life. So I'll tell you what I do know. My way of explaining things may be off-track, but you should get the general jist anyway.

Perl isn't CGI per se, it's just one language that's used as part of the CGI subset of programming languages. Perl can be slower in comparison to other languages, because every time a Perl program or script is run it has to be compiled by the Perl executable. Some CGI languages, like C or C++ are compiled once, before you make the program available, so it doesn't have to be compiled every time and so it's faster. On smaller sites you would hardly notice the difference, but on large, completely dynamic sites, using Perl could slow the server down.

PHP and ASP are faster because they're built into the webserver. There's also Cold Fusion (.cfm), which seems to be have a very dedicated following (people who use Cold Fusion are always hanging around boards like this trying to get everybody else to change over Smile).

I think the main reason that Perl is used so much is because it can be quite easy to work with and there's thousands upon thousands of scripts readily available out there for people to install and play with on their servers, making it easier to learn.

The reason a lot of people seem to move on to php, asp or cfm is because interactive, database-driven sites are now becoming the standard, particularly on large sites, where site-wide modifications could take weeks if they did it a page at a time. Most of these sites interface to a database very well, so if they want to change the details of a navbar or their banner advertising across the site they just have to bunk into the database and change something. And a lot of the time they use php, asp or cfm because as I said, Perl would be inclined to add an overhead on large sites.

So it really depends on each persons knowledge and capabilites. If you have a huge site and you want it to be a little faster or easier to update, maybe you would be better off switching over. On the other hand, I have several small to medium sized sites that run almost entirely on SSI and Perl and they run quite fast.

As to PHP v ASP, I personally would go for PHP, because I've never visited an asp site without coming across an error. Never. Whether that's down to poor site development or another crappy Microsoft product I don't know, but that turned me off. PHP is pretty easy to use, and in some cases it's even easier than perl, but there isn't as much freely available source code out there, so you can be in the dark sometimes.

That's my two cents, but no doubt someone will come along and explain it better than me... Smile

adam
Quote Reply
Re: Perl/CGI vs PHP or ASP ...?? In reply to
Thanks dahamsta,

Thanks for the info. I'll check out the PHP site. I'm trying to stay away from "proprietary" software so Cold Fusion won't be an option for me.
Quote Reply
Re: Perl/CGI vs PHP or ASP ...?? In reply to
If you are looking for serious performance/flexibility, consider using mod_perl. The downside is you will probably need your own web server.

Cheers,

Alex