Re: Best way to attach a module to /

2001-06-15 Thread Thomas Klausner

Hi!


On 14 Jun 2001, at 14:03, Andrew Ho wrote:
> JK>What is the best way to attach a module to be run when a user first
> JK>enters the site?
> GED>Can you be a bit more specific?

> I think the question is better phrased by the subject, "how can I
> use mod_perl to handle all requests?"
> ..

This works also:


SetHandler perl-script
PerlHandler My::Module


I think you can use this to "unset" mod_perl:
(I've seen it on the list but didn't try it ..)


SetHandler default





--
D_omm
O_xyderkes http://domm.zsi.at
M_echanen
M_asteuei



Re: Best way to attach a module to /

2001-06-14 Thread Andrew Ho

Hello,

JK>What is the best way to attach a module to be run when a user first
JK>enters the site?

GED>Can you be a bit more specific?

I think the question is better phrased by the subject, "how can I
use mod_perl to handle all requests?"

This is less intuitive than the much more easily understandable "how can I
use mod_perl to handle a request for a certain URL?" In the latter case
you can use Apache::Registry (and associate it with LocationMatch or
FilesMatch or whatever) or an explicit handler. In the former case, it's
not as obvious.

One solution is to use a PerlTransHandler with a dispatch table in it. The
PerlTransHandler will be called on all requests, and you can inspect
$r->uri to see if you want to handle it. Return DECLINED if it's not
something you're interested in handling (say a /images URL); otherwise,
handle the request right away, internally redirect to another handler, or
just directly add the handlers you want down the chain.

Hope that helps--

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--




Re: Best way to attach a module to /

2001-06-14 Thread Ged Haywood

Hi there,

On Thu, 14 Jun 2001, Jamie Krasnoo wrote:

> What is the best way to attach a module to be run when a user first
> enters the site?

Can you be a bit more specific?

73,
Ged.