Why is Perl commonly used to write CGI scripts?

I plan to add a better search function to my site, so I thought that I would write it in C and use CGI as a means to access it. But Perl seems to be the most popular language when it comes to CGI-based content. Why is this? Wouldn't that be faster programmed in C or machine code?

What benefits, if any, are there to write it in a scripting language?

Thank.

+5
source share
8 answers

The day CGI became popular, Perl was the easiest language to use. People could quickly pick up the “Perl child,” and since the program was a text file, they could easily download it and transfer it. Since Perl began to work as a system administration language, many servers have already installed it. When it's time to make a CGI script on some kind of hosting service, Perl is most likely already there. Not only that, the Perl script is practically no different from any platform, so what you wrote locally most likely worked exactly the same on another machine.

" " , , , ; Perl , . , C, ( ).

Perl , . Perl , , - . PHP, , ( , , ).

, Perl . CPAN, , Perl CGI.

Perl CGI, . - , , , , .

CGI 1994 , , , . , Seaside, , . , Smalltalk.:)

+19

, . C, , , , .. - . , , , . ; , Java #, , ( ) ++ std::string C .

Securitywise, Perl , : "taint". , .. CGI, script , . Taint , , - , , .

, Perl CGI, , .., . , CPAN , .

+6

, . , , :

:

  • CGI C ( , ). CGI ( , CGI ).
  • CGI Perl
  • CGI Perl CPAN.

, C , " , ". , , CGI , HTML .

CGI Perl CGI, , , C, - , .

CPAN Perl , -, .

+4

Perl - CPAN.

+3

, - , . - Perl, C, , . C .

+3

, -, C, - . , , script . , , , , .

, , , . , C, : PHP, , , C, . C, .

+2

, - , , , C.

, , , ... , , C - (, XS perl pythons c-api)

0

, CGI , -, , , . - , .

, , , Perl. , NCSA httpd CGI-, Perl, C shell. , , CGI. C , Perl .

, Perl CGI :

  • .
  • , ; CGI.pm Perl.
  • Perl .

There is no reason Perl should be used; any language that can work with Unix environment variables is appropriate.

This suggests that CGI did not like because it is very slow regarding languages ​​that work in the address space of a web server, such as PHP.

-2
source

All Articles