On Tue, 4 Dec 2001 12:06:56 -0600, "Elizabeth Vaughn" 
<[EMAIL PROTECTED]> wrote :

> 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.

It's funny Elizabeth, I was just thinking you were doing a much better job 
than me explain the problem.

Here's how my little 'trouble' arises.

I have an application. If no other runmode is specifed, by default it runs 
something like 'show_login_page()' in MyApp::Login. This one is plain and 
simple CGI::App the way it was meant to be. The user enters username and 
password and hits submit. A runmode like 'validate_login()' is called in 
MyApp::Login. If the username/password is valid then a runmode like 
'show_homepage' will be run in MyApp::Home. Because of the runmode/print 
way CGI::App currently runs, the output I get is this:

<sample output>
Content-type: text/html

Content-type: text/html

<... output of show_homepage() goes here ...>

</sample output>

If I could do runmode/runmode/print all would be fine.
I could put show_homepage() in with the other login runmodes, but I'll 
want to call it from other places too. In the case of one app I'm working 
on, a web hosting account management package, there would be other 
modules, like MyApp::ManageEmail, or MyApp::ManageDNS, or MyApp::Billing 
which like MyApp::Login would start with simple runmode/print, but would 
at least at the end, return back to show_homepage() in MyApp 
()runmode/runmode/print. It may also make sense that while a user was 
managing their DNS MX (mail exchanger) in MyApp::ManageDNS the option to 
switch over to viewing their email config (in MyApp::ManageEmail) might be 
handy (actually probably not that useful, but you get the general idea).

Where I spend most of my day working, the majority of our programmers are 
interns on 4-8 month stays. So designing systems that can be easily 
extended with 'pluggable' modules (add/remove 'use MyApp::ManageDNS' from 
the instance script and all its functionality is enable/disabled) is very 
important. Because I also work for/with a large Canadian government 
departments, we also have standard look and feel templates, and 
bilingualism issues to deal with, so being able to wrap one of two 
standard templates around a runmode's output outside of the runmode is 
also a huge benefit.

I use CGI::App cause it's a very simple yet effective module that handles 
most of my requirements. I've looked at others, like HTML::Mason, and most 
were just too involved for my relatively simple undertaking. I'm going to 
use a sub-class to seperate the action() and output() from run(), but it 
would seem to me that this could be implemented in the core module and it 
would provide the same functionality the current implementation for those 
who need it, but would allow the flexibility for those who want it.

Just my two cents. Don't think that was fewer words though, Elizabeth. =)

Christopher
[EMAIL PROTECTED]


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

Reply via email to