Perrin Harkins wrote:
[...]
Well, again, there's nothing wrong with globals when used carefully, and
this solution does use them for storing things.

If you're using mod_perl 1, you can do this to get $r:

my $r = Apache->request();

If you're using mod_perl 2, you can do this:

You can do the same with mp2. As long as running under 'SetHandler perl-script' or having 'PerlOptions +GlobalRequest', though it will be available only during the response handler.


# in your handler
my $r = shift;
Matt::Resources->set_req($r);

BTW, that's what newer CGI.pm versions support. You can now pass $r to the CGI::new() method, so you don't have to rely on Apache->request(); being available.



__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to