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

NAME

Apache2::ASP::SimpleCGI - Basic CGI functionality

SYNOPSIS

  use Apache2::ASP::SimpleCGI;
  
  my $cgi = Apache2::ASP::SimpleCGI->new(
    content_type    => 'multipart/form-data',
    content_length  => 1200,
    querystring     => 'mode=create&uploadID=234234',
    body            => ...
  );
  
  my $val = $cgi->param('mode');
  foreach my $key ( $cgi->param )
  {
    print $key . ' --> ' . $cgi->param( $key ) . "\n";
  }# end foreach()
  
  my $escaped = $cgi->escape( 'Hello world' );
  my $unescaped = $cgi->unescape( 'Hello+world' );
  
  my $upload = $cgi->upload('filename');
  
  my $filehandle = $cgi->upload_info('filename', 'filehandle' );

DESCRIPTION

This package provides basic CGI functionality and is also used for testing and in the API enironment.

Apache2::ASP::SimpleCGI uses HTTP::Body under the hood.

PUBLIC METHODS

new( %args )

Returns a new Apache2::ASP::SimpleCGI object.

%args can contain content_type, content_length, querystring and body.

param( [$key] )

If $key is given, returns the value of the form or querystring parameter by that name.

If $key is not given, returns a list of all parameter names.

escape( $str )

Returns a URL-encoded version of $str.

unescape( $str )

Returns a URL-decoded version of $str.

upload( $field_name )

Returns all of the information we have about a file upload named $field_name.

upload_info( $field_name, $item_name )

Returns just that part of $field_name's upload info.

BUGS

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.

HOMEPAGE

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR

John Drago mailto:jdrago_999@yahoo.com

COPYRIGHT AND LICENSE

Copyright 2007 John Drago, All rights reserved.

This software is free software. It may be used and distributed under the same terms as Perl itself.