CGI Perl


A Simple Form-Based Example


Please enter your name:


First name: 


Last name: 




#!/usr/bin/perl
use strict;
use warnings;
use CGI;
my $cgi=new CGI; #read in parameters
print $cgi->header(); #print a header
print $cgi->start_html("Welcome"); #generate HTML document start
print "

Welcome, ",$cgi->param('first')," ",$cgi->param('last'),"

";
print $cgi->end_html(); #finish HTML document