CGI::Ex

CGI Utility Suite - Makes powerful application writing fun and easy

SYNOPSIS

### You probably don't want to use CGI::Ex directly
### You probably should use CGI::Ex::App instead.

my $cgix = CGI::Ex->new;

$cgix->print_content_type;

my $hash = $cgix->form;

if ($hash->{'bounce'}) {

    $cgix->set_cookie({
        name  => ...,
        value => ...,
    });

    $cgix->location_bounce($new_url_location);

    exit;
}

if (scalar keys %$form) {

    my $val_hash = $cgix->conf_read($pathtovalidation);
    my $err_obj  = $cgix->validate($hash, $val_hash);

    if ($err_obj) {

        my $errors  = $err_obj->as_hash;
        my $input   = "Some content";
        my $content = "";

        $cgix->swap_template(\$input, $errors, $content);
        $cgix->fill({text => \$content, form => $hashref});

        print $content;

        exit;
    } else {
        print "Success";
    }
} else {
    print "Main page";
}

DESCRIPTION

CGI::Ex provides a suite of utilities to make writing CGI scripts more enjoyable.

Although they can all be used separately, the main functionality of each of the modules is best represented in the CGI::Ex::App module. CGI::Ex::App takes CGI application building to the next step. CGI::Ex::App is not quite a framework (which normally includes pre-built HTML); it's an extended application flow that dramatically reduces CGI build-time in most cases. It does so using as little magic as possible.

The main functionality is provided by several other modules that may be used separately, or together through the CGI::Ex interface.

CGI::Ex METHODS

For further examples, please see the code contained in t/samples/cgi_ex_* of this distribution.

If at a later date, the developer upgrades to Template::Toolkit, the templates that were being swapped by CGI::Ex::swap_template should be compatible with Template::Toolkit.

MODULES

See also CGI::Ex::App.

See also CGI::Ex::Auth.

See also CGI::Ex::Conf.

See also CGI::Ex::Die.

See also CGI::Ex::Dump.

See also CGI::Ex::Fill.

See also CGI::Ex::Template.

See also CGI::Ex::Validate.

LICENSE

This module may be distributed under the same terms as Perl itself.

AUTHOR

Paul Seamons <paul@seamons.com>