Basic HTML version of Foils prepared Sept 20 97

Foil 78 CGI.pm Syntax

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


Use object-oriented Perl5 syntax:
use CGI;
my $query = CGI->new(); # new query object
my $val = $query->param(foo);
or ordinary Perl4 function calls:
use CGI qw(:standard);
my $val = param(foo);
With CGI.pm, it's easy to write self-contained CGI scripts:
use CGI qw(:standard);
if ( param() ) {
  • # process data from HTML form
} else {
  • # generate HTML form
}



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997