The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CGI::Echo - Echo form data to test form design.

Synopsis

This is complete, tested program:

        #!/usr/bin/perl -wT

        use lib '.';
        use strict;

        use CGI;
        use CGI::Echo;

        # -----------------------------------------------

        my($q) = CGI -> new();

        CGI::Echo -> new(q => $q) -> print();

Description

This module accepts form data, cleans it, and echos it.

It is designed for a HTML/CGI student enviroment. It lets, indeed encourages, students to design forms and gives their long-suffering instructors a simple way to provide a CGI script which accepts the form data, and just echos it.

Distributions

This module is available both as a Unix-style distro (*.tgz) and an ActiveState-style distro (*.ppd). The latter is shipped in a *.zip file.

See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing each type of distro.

Usage

See the synopsis.

Options

Here, in alphabetical order, are the options accepted by the constructor, together with their default values.

css => ''

This is the name of a CSS file which makes the sample form and the echoed data look pretty.

See examples/default.css for a sample CSS file.

q => ''

This is the CGI object used by CGI::Echo to do the work.

title => 'Echo Test'

This is the text used in the page title and as a heading when the form data is echoed.

Methods

new(%arg): The constructor

See the previous section for details.

print(%arg): Display the form data

Call this to output a table containing the form data.

print(%arg) takes the same parameters as new().

set(%arg): Set class member options

Call this to set options after calling new().

set(%arg) takes the same parameters as new().

A Sample Form

The synopsis in Echo.pm contains the only script you'll need. You'll find the code in examples/echo.cgi.

A sample form, examples/test-echo.html, is shipped to bootstrap the design process.

Author

CGI::Echo was written by Ron Savage <ron@savage.net.au> in 2002.

Home page: http://savage.net.au/index.html

Copyright

Australian copyright (c) 2002, Ron Savage. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html