[ic] Redirecting output of Interchange

Dylan Oliver doliver@hampshire.edu
Sat, 24 Feb 2001 23:16:31 -0600

On Sat, 24 Feb 2001 21:51:32 -0500
cfm@maine.com wrote:

> I've not used Mason, only know it by name.  It's on my list of things
> to look at and steal feature from.  :-)

See www.masonhq.com. It gives me a warm, fuzzy feeling, and I don't use a
tenth of what it offers. Perhaps Interchange's authors could borrow a few
features or facilitate integration? With Mason, for instance, an
"autohandler" in your documentroot will apply to every top-level component
(like index.html) under it (unless disabled), and each directory can use
its own which can inherit from the higher-level autohandler or stand on
its own. When you're using @_LEFTONLY_TOP_@ in most pages, it's easier to
put it in an autohandler and disable it for the few pages that don't use
it. Nice, nice, nice.
> > Do you mean that you passed pages through your site builder and then
> Yes. We do it both static and dynamic.
> > And if so, how can I insert Mason in
> > the Interchange process? 
> Something like this is how we build a typical minivend page:

I'll have to take time to sort this out; I'm new to perl and dtd's. It
occurs to me, though, that I'd rather put the embedded call to HTML::Mason
in an Interchange template than add the whole call to each page (though
I'll still have to include a call to the template in each page - too bad
there's no autohandler!). And Mason's cacheing features should make the
some/file/mason/builds/every/two/hours' a cinche.

Still, I'd like to look into piping Interchange's output through Mason's
handler.cgi. I don't see a mess in that. It's very simple, really -
Interchange receives a request for a page, say
/cgi-bin/catalog/index.html, parses it, passes the result to Mason's
handler.cgi, and it's then parsed as any other component.  So all I have
to do, it seems, is redirect the output of /cgi-bin/catalog from what?
Apache? to /cgi-bin/handler.cgi. Can't be that hard! So how do I do that?

Dylan Oliver

Do you know how little you know?