Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to write a Perl CGI application?

Tags:

cgi

perl

Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML, and this doesn't seem like the best way to write a CGI app. Is there a better way to do this? Thanks.

EDIT: I've decided to use CGI::Application and HTML::Template, and use the following tutorial: http://docs.google.com/View?docid=dd363fg9_77gb4hdh7b. Thanks!

like image 450
ristonj Avatar asked Nov 24 '08 16:11

ristonj


People also ask

How do you write a CGI script?

First CGI Program Here is a simple link, which is linked to a CGI script called hello.py. This file is kept in /var/www/cgi-bin directory and it has following content. Before running your CGI program, make sure you have change mode of file using chmod 755 hello.py UNIX command to make file executable.

What programming language is used for CGI?

CGI applications can be written in any computer programming language that is supported by the host computer, including compiled languages such as C and FORTRAN and scripting languages such as Perl and TCL.

Why Perl is the language of choice for programming in CGI?

Perl is by far the most widely used language for CGI programming! It contains many powerful features, and is very easy for the novice programmer to learn. The advantages of Perl include: It is highly portable and readily available.


1 Answers

Absolutely (you're probably looking at tutorials from the 90s). You'll want to pick a framework. In Perl-land these are the most popular choices:

  • CGI::Application - very lightweight with lots of community plugins
  • Catalyst - heavier with more bells and whistles
  • Jifty - more magical than the above
like image 116
mpeters Avatar answered Oct 21 '22 03:10

mpeters