CGI.pm

CGI.Pm

Software
Software Less

CGI.pm

to get instant updates about 'CGI.Pm' on your MyPage. Meet other similar minded people. Its Free!

X 

All Updates


Description:
CGI.pm is a large and widely used Perl module for programming Common Gateway Interface (CGI) web applications, providing a consistent API for receiving user input and producing HTML or XHTML output.

The module was written Lincoln Stein and is now maintained by Mark Stosberg.

A Sample CGI Page

Here is a simple CGI page, written in Perl using CGI.pm (in object oriented style):

<source lang="perl">
  1. !/usr/bin/perl


use strict;use warnings;use CGI;

my $cgi = CGI->new();

print
   $cgi->header('text/html'),
   $cgi->start_html('A Simple CGI Page'),
   $cgi->h1('A Simple CGI Page'),
   $cgi->start_form,
   'Name: ',
   $cgi->textfield('name'), $cgi->br,
   'Age: ',
   $cgi->textfield('age'), $cgi->p,
   $cgi->submit('Submit!'),
   $cgi->end_form, $cgi->p,
   $cgi->hr;


if ( $cgi->param('name') )

if ( $cgi->param('age') )

print $cgi->end_html;</source>

This would print a very simple webform, asking for your name and age, and after having been submitted, redisplaying the form with the name and age displayed below it. This sample makes use of CGI.pm's object-oriented abilities; it can also be done by calling functions directly, without the <tt>$cgi-></tt>.

Note: in many examples $q, short for query, is used to store a CGI object. As the above example illustrates, this might be very misleading.

Here is another script that produces the same output using CGI.pm's procedural interface:

<source...
Read More

No feeds found

All
Posting your question. Please wait!...


About

Software
No messages found
Suggested Pages
Tell your friends >
about this page
 Create a new Page
for companies, colleges, celebrities or anything you like.Get updates on MyPage.
Create a new Page
 Find your friends
  Find friends on MyPage from