PDA

View Full Version : PERL in HTML?


Hiei
06-24-2004, 10:43 PM
i want to use some of my perl codes in my website. can you do this or do i have to rewrite the code i want in js or php?

gsnedders
06-24-2004, 10:55 PM
As far as I know, if you give your files the .cgi extension, and put them in the cgi-bin, it should work.

Mhtml
06-25-2004, 08:42 AM
We have a PERL forum for this stuff :thumbsup: ... *moving*

davido
06-29-2004, 07:06 AM
Hiei,

You have to keep in mind that there are two sides to what you see rendered in a browser. There is the client side, and the server side. On the client side it is common to see some of the work done by Javascript. On the server side, it is common to see some of the work done by Perl (among others). This server-side programming is often referred to as CGI. This name means, "Common Gateway Interface", and represents the way that programmers are able to run code on the webserver that creates dynamic HTML (and even dynamic Javascript) on the fly, to be rendered server-side in peoples' browsers. Because HTML can be created dynamically on the server, CGI is often used as the glue between databases and end users. Or as the back end for shopping carts, search engines, and so on.

Perl is well suited to this application, so to answer your question, yes, you may use Perl to create dynamic HTML. But traditionally, this means that the code resides and runs on the server (this is how CGI works).

You should take a look at the Mouse book by O'Reilly and Associates, called, "CGI Programming with Perl", if you're interested in this topic.