[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re-factoring 'print' for $r


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 < suppressed> 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


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.