Thanks Colin,

When I try that within a package and just use:

     $r->print( "Hello");

I still get:

  "Global $r object is not available. Set:\n\tPerlOptions +GlobalRequest\nin
httpd.conf"

But, I do get the correct response when I use $mnh::r->print( "Hello");


FYI - package mhn uses

   use Apache2::RequestUtil ();
   use Apache2::RequestRec ();
   use Apache2::RequestIO ();
   use Apache2::Const -compile => qw(:common);


Any ideas?  I'm likely overlooking something very basic here.


-W



On Dec 22, 2007 12:44 PM, Colin Wetherbee <[EMAIL PROTECTED]> wrote:

> Will Fould wrote:
> > Is this a reasonable approach? Is it typical to refer to the request
> > object by package name rather than try to painfully re-factor all
> > packages and subs to accept $r as a passed reference?
>
> I don't know if this will help your re-factoring, but you should note
> you can always get the current $r with the following code.
>
> my $r = Apache2::RequestUtil->request;
>
> Colin
>

Reply via email to