Jay J wrote:
>
> ----- Original Message -----
> From: "Michael Dearman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 10, 1999 5:35 AM
> Subject: Newbie: Running script using Apache API
>
> > Howdy all,
> >
> > Trying to run a script from the Eagle Book (ch.4 Example 4-14)
> > Using the Apache API, so it looks like:
> >
> > #!/usr/bin/perl -w
> > # file perl/hello3.pl
> >
> > use strict:
> >
> > my $r-> = Apache->request;
> > $r->content_type('text/html');
> > $r->send_http_header;
> > return OK unless $r->header_only;
> > .
> > And so on. Like a module.pm in other words.
> >
> > It doesn't work. The 'perl/' dir is the one set up for other scripts.
> > The perl.conf for this dir is per book directions.
> >
> > <Location /perl>
> > SetHandler perl-script
> > PerlHandler Apache::Registry
> > PerlSendHeader On
> > Options +ExecCGI
> > </Location>
> [snip]
> > Thanks,
> > M. Dearman
>
> Hey Michael,
>
> You seem to have missed something along the way. The answer actually lies in
> your own explanation of the problem.
>
> For that location, you already have a handler -> Apache::Registry, what you
> want* is your .pm as the handler for a particular location. I think if you
> page back a chapter or two you'll see examples of how httpd.conf or
> .htaccess files should be setup.
>
> -Jay J
>
> (omitting all mention [except this] of stacked handlers for this example)
Hi Jay, and all,
Can appreciate that - and have seen this mentioned in the GuestBook
example.
But on page 144 the authors state that you can use scripts in an
Apache::Registry
enabled directory (in may case /perl) that either use the CGI
environment OR scripts
that use the API environment. Heck, they state you can mix the 2 types.
And have been successful in using calls to apache like 'my $r =
Apache->request'
I have refined my problem while writing this.
When I comment out the line ' return OK unless $r->header_only ' it
works.
So apparently I just got to get Apache::Constants to pick up the 'OK'.
Otherwise it sees it as a bareword.
I had tried sticking in a ' use Apache::Constants qw(:common) in the
script.
Below the ' use strict '. Did not work.
And I do have ' use Apache::Constants (); ' in the startup.pl file
Shouldn't that catch the :common variety?
Also tried return 200, return HTTP_OK, in all manner of quote schemes
and
still not working.
Thanks,
M. Dearman