About PHP vs. Perl

Started by ipt, Aug 09, 2022, 12:19 AM

Previous topic - Next topic

iptTopic starter

Hi! There are some questions:
I have been writing in PHP for quite a long time, but now I began to pay attention that in many large companies Perl is more in demand than PHP. Yes, and in the reviews I read that it is allegedly faster than php (in the speed of script execution), by the way, is this really so or is there really no difference?

Then I read about the horrors of the pearl, like the 500th error or the difficult processing of data that came from forms. I tried some modules , yes, they fix the whole thing, but will they be hosted? Or can you put them there yourself?

And one more thing - is it a good idea to keep all scripts in cgi-bin, or are there some workarounds and more elegant options? In general, of course, after php it is not very convenient that you cannot shove a regular html page into this directory.
  •  

RoyJones

Modules that do not require compilation can simply be placed next to the script and called by the full path. A module that requires compilation can be installed for yourself if the hosting provides development tools.

As for PHP vs Perl, I can say one thing... PHP is already a serious language (although some of its features are cute), but it also has a visible simplicity. As a result, all would-be webwriters start their crafts in PHP. Therefore, the number of leaky, crooked scribbles in PHP is many times greater than in Perl. Those. in fact, an active attempt to lower the level of the programmer to enter the language for PHP brings the expected result - the loss of the image.

At the same time, you can write in PCP, and you can write very seriously. I speak as a Perl programmer with 9 years of experience =)
As for perl, it's 50% a regular expression language... which was borrowed by a lot of people (including PHP), and even Unix console utilities are slowly abandoning POSIX regexp by switching to pearl ones. So it is worth getting acquainted with the language at least from this perspective.

As a result, I agree with the previous post - if there is enough PCP, write on it. If you have time and desire - learn Perl - it will not be a minus, a fact. On the contrary, it will give a lot of exp =))
Calling a pearl is already other matter. Let's just say - by the principle of calling, Pearl does not differ from PHP (for example, for Apache it happens through the handler), the difference is made by the web server itself.
The standard scheme is that the php handler is assigned to the file extension, while perl and other CGI handlers need to be called through the ScripAlias folder. But, the web server has given the means to change this principle, even available through .htaccess.

For Apache, I advise you to read http://httpd.apache.org/docs/
If you manage the web server yourself, then in my memory there were 2 modules for Apache - embedded perl solutions ... one for mod_perl, the other for working with a regular perl.
Well, for errors ... each server has an error_log. If the hosting provider does not give access to this file in one way or another, then change the hosting, because the file is very useful.
  •