> But to get back to my question, is there any way to get the
> output of a run
> mode without the headers attached. I am already using
> '$ENV{CGI_APP_RETURN_ONLY} = 1' to grab the output without
> printing it to
> the browser (so I can wrap an application wide template
> around it). I'd like
> to be able to have run modes that instead of returning
> output, perform some
> action and then call on a second run mode which returns the
> output. At the
> moment what this does is return the output which two headers
> attached (the
> first header, no output, the second header, the output). I
> can regex the
> headers out and add my own, but is there a better (cleaner)
> way of going
> about wrapping the output of two (or more) run modes with
> only one header.
>
> Thanks.
>
> Christopher S. Hyne
> [EMAIL PROTECTED]
>

I have a very similar application and the same set of issues.  Additionally,
I have a small concern about using CGI_APP_RETURN_ONLY since the comment
that goes along with it is "serious debug mode only".  It strikes me that
this variable was used for developement of CGI::Application and it may not
be very clean to use it in production.  Does anyone want to comment on the
long-term use of this the variable?

In my current solution, I have a sub-class of CGI::App with two new subs:
action() and output() that are called by run().  action() replaces the first
half of run() and evaluates the run-mode.  output() replaces the second half
or run() and builds, prints and returns $output.  This cleanly separates
processing the run-mode from generating the output, which in my opinion is
as it should be.  Then, I can further override output() to do nothing for
the instances where I only want the "traffic cop".

HOWEVER, this has to ultimately be the wrong answer because it just doesn't
allow for clean upgrades to new versions of CGI::App.  Unless there is
interest in making the seperation or run() into action() and ouput() a
permanent thing.?  Or something like it?

Elizabeth Vaughn


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to