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


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

in Table To:


© 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