From 52b63e9e0c0e3d3019a2751158f59cae036b6fe4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 15 Mar 2008 00:08:38 +0100 Subject: [PATCH] make mod_perl request object a global in PLP::Apache only No reason to always create $PLP::r, as it's only used with Apache. --- PLP.pm | 1 - PLP/Apache.pm | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PLP.pm b/PLP.pm index a919cb7..5899af3 100644 --- a/PLP.pm +++ b/PLP.pm @@ -44,7 +44,6 @@ sub clean { $PLP::sentheaders = 0; $PLP::DEBUG = 1; $PLP::print = ''; - $PLP::r = undef; delete @ENV{ grep /^PLP_/, keys %ENV }; } diff --git a/PLP/Apache.pm b/PLP/Apache.pm index bc78881..6b28f94 100644 --- a/PLP/Apache.pm +++ b/PLP/Apache.pm @@ -21,9 +21,11 @@ BEGIN { } } +our $r; + # mod_perl initializer: returns 0 on success, Apache error code on failure sub init { - our $r = shift; + $r = shift; $PLP::print = 'PLP::Apache::print'; $PLP::read = \&read; @@ -60,7 +62,7 @@ sub read ($) { sub print { return unless grep length, @_; PLP::sendheaders() unless $PLP::sentheaders; - $PLP::Apache::r->print(@_); + $r->print(@_); } # This is the mod_perl handler. -- 2.30.0