| Apache2-ASP documentation | Contained in the Apache2-ASP distribution. |
Apache2::ASP::ModPerl2CGI - A wrapper for CGI utility functions.
Uses CGI::Apache2::Wrapper behind the scenes. Handles file uploads and parsing form data.
Generally only used within Apache2::ASP classes, so casual users don't have to worry about
this module too much.
Returns a new Apache2::ASP::ModPerl2CGI object - with or without an upload hook specified.
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.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago mailto:jdrago_999@yahoo.com
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.
| Apache2-ASP documentation | Contained in the Apache2-ASP distribution. |
package Apache2::ASP::ModPerl2CGI; use strict; use warnings; use base 'CGI::Apache2::Wrapper'; use Apache2::ASP::SimpleCGI; use Carp 'confess'; #============================================================================== sub new { my ($class, $r, $upload_hook) = @_; my $s = $class->SUPER::new( $r ); $s->{r} = $r; if( ref($upload_hook) eq 'CODE' ) { my $req = Apache2::Request->new( $r, UPLOAD_HOOK => $upload_hook, ); $s->req( $req ); } else { $s->req( Apache2::Request->new( $r ) ); }# end if() return $s; }# end new() #============================================================================== sub escape { my ($s, $str) = @_; return Apache2::ASP::SimpleCGI->escape( $str ); }# end escape() #============================================================================== sub unescape { my ($s, $str) = @_; return Apache2::ASP::SimpleCGI->unescape( $str ); }# end unescape() #============================================================================== sub AUTOLOAD { my $s = shift; our $AUTOLOAD; my ($name) = $AUTOLOAD =~ m/([^:]+)$/; eval { return $s->{r}->$name( @_ ) }; confess $@ if $@; }# end AUTOLOAD() #============================================================================== sub DESTROY { my $s = shift; delete($s->{$_}) foreach keys(%$s); }# end DESTROY() 1;# return true: __END__