Mark,

Let me start by saying that I am having a difficult time presenting this
concept.  From my way of looking at this, I DO want to ALWAYS return some
output.  However, everyone who responds to me asks me why I don't want to
return some output, so I am clearly expressing myself badly.

Let me try it this way: I always want to return output - I just want to do
something else first and the decision about which something else doesn't
have anything to do with the decision about which output.  Think of it as
using CGI::App to implement two different decision trees - one is what to do
with what I got back and one is where to go next and they don't have
anything to do with each other (well not really, but you get the idea).

As an example, I sometimes have the same form which can be accessed by
people with different "login types".  The code to process the form is
identical, but the code to generate the output is different.  This would be
a case where run_mode/run_mode/print would seem to work well.  The first
run_mode method is used to process the form, but needs to produces no
output.  Control is then passed to the second run_mode to produce the
appropriate output, in this case based on the "login type".

This can certainly be done other ways, most simply by sticking the
appropriate if-then-else tree for which output I need within the method
which processes the form.  I just hate if-then-else trees and it seems like
I can get some rather elegant re-usability of both "actions" and "output"
within the run_mode paradigm if I can gain a little more control over the
timing of the output.

If this is still completely Greek, maybe Christopher would like to take a
stab at it.  He seems to do a much better job of stating the problem in far
fewer words.

Thanks for your interest and patience,
Elizabeth


> -----Original Message-----
> From: Mark Stosberg [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 04, 2001 11:15 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [cgiapp] Grab output of a run mode without headers
>
>
> Elizabeth Vaughn wrote:
> >
> > I'd be happy to provide a very specific example if this
> would help.  Bottom
> > line is I love the module and don't want to stop using it!
> The way I see
> > it, it's not that I am trying to wedge a square peg into a
> round hole, it's
> > just that my round peg is slightly larger than the existing
> round hole.
>
> I'm interested in seeing an example. I'm having trouble imagining the
> case where you don't ultimately want to return some output, but it's
> still a CGI application.
>
> The one exception I've found myself is when I need to send some
> unbuffered output. That's easy enough to do though: I just end my own
> headers and then exit before returning from the run mode.
>
>   -mark
>
>  . . . . . . . . . . . . . . . . . . . . . . . . . .
>    Mark Stosberg              Principal Developer
>    [EMAIL PROTECTED]       Summersault, LLC
>    v: 765-939-9301 ext 223    website development
>  . . . . . http://www.summersault.com/ . . . . . . .
>


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

Reply via email to