summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eg/cgi/customize.cgi2
-rw-r--r--eg/cgi/tryit.cgi2
-rw-r--r--lib/CGI.pm14
-rw-r--r--lib/CGI/Apache.pm17
4 files changed, 23 insertions, 12 deletions
diff --git a/eg/cgi/customize.cgi b/eg/cgi/customize.cgi
index d932f4ba23..c1c8187514 100644
--- a/eg/cgi/customize.cgi
+++ b/eg/cgi/customize.cgi
@@ -89,4 +89,4 @@ print hr(),
hr;
print a({HREF=>"/"},'Go to the home page');
-
+print end_html;
diff --git a/eg/cgi/tryit.cgi b/eg/cgi/tryit.cgi
index 155cd72a59..83c620c3e4 100644
--- a/eg/cgi/tryit.cgi
+++ b/eg/cgi/tryit.cgi
@@ -32,4 +32,6 @@ if (param()) {
hr;
}
print a({href=>'../cgi_docs.html'},'Go to the documentation');
+print end_html;
+
diff --git a/lib/CGI.pm b/lib/CGI.pm
index 28fe43b2f1..30ad7a7bba 100644
--- a/lib/CGI.pm
+++ b/lib/CGI.pm
@@ -28,8 +28,8 @@ $AUTOLOAD_DEBUG=0;
# 3) print header(-nph=>1)
$NPH=0;
-$CGI::revision = '$Id: CGI.pm,v 2.32 1997/3/19 10:10 lstein Exp $';
-$CGI::VERSION='2.3202';
+$CGI::revision = '$Id: CGI.pm,v 2.34 1997/4/7 7:23 lstein Exp $';
+$CGI::VERSION='2.3401';
# OVERRIDE THE OS HERE IF CGI.pm GUESSES WRONG
# $OS = 'UNIX';
@@ -87,9 +87,7 @@ $SL = {
$NPH++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/;
# Turn on special checking for Doug MacEachern's modperl
-if (defined($MOD_PERL = $ENV{'GATEWAY_INTERFACE'}) &&
- $MOD_PERL =~ /^CGI-Perl/)
-{
+if (defined($ENV{'GATEWAY_INTERFACE'}) && ($MOD_PERL = $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl/)) {
$NPH++;
$| = 1;
$SEQNO = 1;
@@ -176,7 +174,6 @@ sub new {
my($class,$initializer) = @_;
my $self = {};
bless $self,ref $class || $class || $DefaultClass;
- $CGI::DefaultClass->_reset_globals() if $MOD_PERL;
$initializer = to_filehandle($initializer) if $initializer;
$self->init($initializer);
return $self;
@@ -986,12 +983,11 @@ END_OF_FUNC
'redirect' => <<'END_OF_FUNC',
sub redirect {
my($self,@p) = self_or_default(@_);
- my($url,$target,$cookie,$nph,@other) =
- $self->rearrange([[URI,URL],TARGET,COOKIE,NPH],@p);
+ my($url,$target,$cookie,$nph,@other) = $self->rearrange([[URI,URL],TARGET,COOKIE,NPH],@p);
$url = $url || $self->self_url;
my(@o);
foreach (@other) { push(@o,split("=")); }
- if ($MOD_PERL or exists $self->{'.req'}) {
+ if($MOD_PERL or exists $self->{'.req'}) {
my $r = $self->{'.req'} || Apache->request;
$r->header_out(Location => $url);
$r->err_header_out(Location => $url);
diff --git a/lib/CGI/Apache.pm b/lib/CGI/Apache.pm
index 6666f19b55..61b55f5205 100644
--- a/lib/CGI/Apache.pm
+++ b/lib/CGI/Apache.pm
@@ -4,10 +4,16 @@ use vars qw(@ISA $VERSION);
require CGI;
@ISA = qw(CGI);
-$VERSION = (qw$Revision: 1.00 $)[1];
+$VERSION = (qw$Revision: 1.01 $)[1];
$CGI::DefaultClass = 'CGI::Apache';
$CGI::Apache::AutoloadClass = 'CGI';
+sub import {
+ my $self = shift;
+ my ($callpack, $callfile, $callline) = caller;
+ ${"${callpack}::AutoloadClass"} = 'CGI';
+}
+
sub new {
my($class) = shift;
my($r) = Apache->request;
@@ -75,10 +81,17 @@ When using the Perl-Apache API, your applications are faster, but the
enviroment is different than CGI.
This module attempts to set-up that environment as best it can.
-=head1 NOTE
+=head1 NOTE 1
This module used to be named Apache::CGI. Sorry for the confusion.
+=head1 NOTE 2
+
+If you're going to inherit from this class, make sure to "use" it
+after your package declaration rather than "require" it. This is
+because CGI.pm does a little magic during the import() step in order
+to make autoloading work correctly.
+
=head1 SEE ALSO
perl(1), Apache(3), CGI(3)