in reply to Re: CGI::Application and CGI pragmas?
in thread CGI::Application and CGI pragmas?

Yeah, I tried that but it seems to step on some mod_perl stuff?

I get an error message like;
Can't locate object method "server" via package "request" (perhaps you forgot to load "request"?)
on some code that looks something like;

my $r = $self->param('request'); $r->server->loglevel(VERBOSE);
This code works before importing :standard
If I just do the pragma nothing seems to happen, i.e. its ignored

Replies are listed 'Best First'.
Re^3: CGI::Application and CGI pragmas?
by cees (Curate) on May 28, 2005 at 00:39 UTC

    OK, that helps a bit. Are you sure you are getting a proper request object when you call $self->param('request')? It would help if you showed us the code that populates that parameter.

    What I would try instead is call Apache->request->server->loglevel(VERBOSE) and see what that does. If that works, then your problem is with the 'request' parameter you set in CGI::Application. Try dumping that variable using Data::Dumper and you will see exactly what you have there.

      Thanks for helping.
      I finally figured it out. The problem is with the

      $self->param('log' => Apache->request->server->log);

      stuff I was doing. If I

      use CGI qw/:standard/

      I pull in param() as well as things like h1(). All I needed to do was

      qw/:html/