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

NAME

CGI - A module for programming CGI

SYNOPSIS

    #!/usr/bin/pugs
    use v6;
    require CGI-0.0.1;
    
    print header;
    
    if (param()) {
        for param() -> $key {
            say $key ~ " => " ~ param($key) ~ "<BR>";
        }
    }
    else {
        say "<FORM><INPUT TYPE='text' NAME='test'><INPUT TYPE='submit'></FORM>";
    }
    
    # you can also test it on the command line too
    % pugs -I lib/ examples/test.p6 "greetings=hello world"    

DESCRIPTION

CGI for Pugs!

FUNCTIONS

Informational

param returns Array
param (Str $key) returns Array
query_string returns Str
request_method returns Str
content_type returns Str
content_length returns Str

The following informational functions are fetched on-demand

path_info returns Str
referer returns Str
request_uri returns Str
document_root returns Str
script_name returns Str

Utility

header (+$status = '200 OK', +$content_type = 'text/html', +$charset, +$location) returns Str
redirect (Str $location) returns Str
url_decode (Str $to_decode) returns Str
url_encode (Str $to_encode) returns Str
pack_params returns Str
unpack_params (Str $data) returns Str

TO DO

Cookies

My inclination is to wait until objects are done for this, but maybe I will figure out a good way to do this without. Either way it is still TODO.

AUTHOR

stevan little, <stevan@iinteractive.com>

Autrijus Tang, <autrijus@autrijus.com>

Curtis "Ovid" Poe

Andras Barthazi, <andras@barthazi.hu>

"Aankhen"

COPYRIGHT

Copyright (c) 2005. Stevan Little. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html