Forum Moderators: coopster & phranque

Message Too Old, No Replies

On using Perl over PHP for website development; why you do or don't.

Wondering about the advantages of developing sites using Perl over PHP

         

stlouislouis

6:35 pm on Dec 9, 2002 (gmt 0)

10+ Year Member



Hi,

The reason I ask this question is because of all the things
one can do with Perl besides website development.
Wondering if Perl would thus be the better language to use
and develop expertise in.

Wondering which to focus on and learn -- Perl or PHP --
for sites needing more than just static content.

For those who feel Perl is the better choice over PHP, could
you please share the reasons why?

Thanks for sharing,

Louis

jeremy goodrich

6:45 pm on Dec 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For me personally, it's because I don't do much 'programming' and learned perl first.

Though for a few reasons, I'm considering learning more php as well, but after more mysql. :)

If it can be done in one, it can be done in the other, generally, except for command line stuff, which I do a bit of, so perl is better there.

Though if it is *only web based stuff* you are after, php is prolly the ticket for you. (course, opinions will vary).

sun818

6:53 pm on Dec 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For some reason, I haven't been able to get any of my content in the /cgi-bin folder to index on Google. So, I'm in the process of migrating to PHP equivalents for those Perl/CGI scripts. Since PHP scripts can reside on any directory, the search engine indexing has been more thorough.

rcjordan

7:11 pm on Dec 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For site-critical functions, I like PERL. Mostly for almost guaranteed portability between servers -should I be forced to move.

ggrot

7:15 pm on Dec 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP is easier (read: less time invested) to work with on a web project. Perl has some serious advantages in heavy text parsing, so I hear, although PHP can do a good bit. I'm a PHP guy myself, and would recommend that you use it.

There is one other advantage to PHP, and that it has limited OOP (object oriented) capability, which, if you are coming from a C++ or Java background, you will know is quite useful.

andreasfriedrich

8:14 pm on Dec 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First of all and formost Perl feels good. Of course that will depend on a good part on your socialization. But then I guess everybody here was brought up using some form of natural language. Perl has a lot of those natural language features. Some may think that is a bad thing, Yahoo did when they decided against using mod_perl. I think it is a good thing: Perl letīs you decide how to do it, it gives you the freedom to choose. If a large project requires a more formal approach what keeps you from establishing stricter coding guidelines yourself.

Perl does not enforce privacy of private variables or methods within objects. It is your choice to adhere to the interface or not. If you do you have the reasonable expectation that the class will behave as documented. If you violate the interface then you are on your own. If you need enforced privacy there is a way to achieve that as well.

As I have written before there is no inherent connection between Perl and CGI. One is a programming language the other a standard for calling programs from a webserver. As for cgi-bin folders and Google I have no idea whatsoever whether the get indexed or not. Personally I do not care since there is no reason to use such a folder at all. Both Perl scripts that get called via CGI or mod_perl scripts may run from whatever directory you configure them to run from. The same holds true for both PHP variants.

Whether or not PHP is easier to work with on a web project probably depends on both the project and your coding experience in any of the two languages.

Currently Iīm playing around with Clean and functional programming languages. This a great and exciting field but probably not suitable for each and every task.

Start with one language but once you have mastered it start looking at other languages too. You do not need to know each and every language equally well but you should know enough to decide whether one language is more suitabe for a given task than another. Again this decision will depend on you skills in each language and the given project.

Perl is more flower power while PHP is rather plain techy stuff. The linguistic quality of Perlīs documentation especially in its O`Reilly variant is by far better then most of PHPīs documentation.

Perl has CPAN, PHP has PEAR. CPAN contains thousands of modules, PEAR very little. Perl has mod_perl which gives you access to the Apache API (C does as well), PHP has 4 Apache related functions. Perl is rather old PHP rather young. Some prefer older things over younger ones some do not. It may even change depending on the thing involved.

If you like Perlīs philosophy you may choose PHP as well.

Andreas