On Thu, 14 Feb 2008, Perrin Harkins wrote:

On Wed, Feb 13, 2008 at 3:08 PM, Petry Roman, IT
<[EMAIL PROTECTED]> wrote:
 Looks ok i think. Apache.pm is loaded.. So why can´t i get it to work.. damn 
thing 8-).

This is starting to look like a bug in Apache2::compat to me.  I think
request() is defined in the wrong namespace.  I'll try to make a patch
for you to try.

Does the attached patch work (untested)?

Do you actually use the Apache->request() call?  In a Registry script,
you can get $r just by calling shift at the beginning of the program.

That's a good point.

--
best regards,
Randy Kobes
Index: lib/Apache2/compat.pm
===================================================================
--- lib/Apache2/compat.pm       (revision 627863)
+++ lib/Apache2/compat.pm       (working copy)
@@ -279,20 +279,6 @@
     }
 }
 
-sub request {
-    my $what = shift;
-
-    my $r = Apache2::RequestUtil->request;
-
-    unless ($r) {
-        die "cannot use $what ",
-            "without 'SetHandler perl-script' ",
-            "or 'PerlOptions +GlobalRequest'";
-    }
-
-    $r;
-}
-
 {
     my $orig_sub = *Apache2::Module::top_module{CODE};
     *Apache2::Module::top_module = sub {
@@ -321,6 +307,20 @@
 
 package Apache;
 
+sub request {
+    my $what = shift;
+
+    my $r = Apache2::RequestUtil->request;
+
+    unless ($r) {
+        die "cannot use $what ",
+            "without 'SetHandler perl-script' ",
+            "or 'PerlOptions +GlobalRequest'";
+    }
+
+    $r;
+}
+
 sub unescape_url_info {
     my ($class, $string) = @_;
     Apache2::URI::unescape_url($string);

Reply via email to