I'm in need of some upper level wisdom sharing. I've been playing around with CGI::Application and while I've made it do what I want it to, there seems to be some things missing (either from it's capabilities, or mine).
So, I've searched the net for some good CGI::App examples of how the pros use it, but I'm met with the same simple examples over and over. These examples show that if you have a large program with 1000 different run modes, well.. you end up with 1000 line of mode1 => \&mode1,. On top of that.. all examples show the &mode1 as being coded inside your main package. Now, while I know that you can clean stuff up by moving the subs to various other modules which can be used in your main package, there doesn't seem to be an easy way of loading only the modules you need based on the run mode. The program assumes the run mode sub is available and runs it. This seems to be extremely unweildy for any large number of subs and run modes. I've looked for examples of a better way to use CGI::Application than the simple run_mode => \&sub in the main package way but can't find any. In the past I used a super simple framework, not as full featured, but at least it had the capability to dynamically load parts of the program when needed, rather than the whole shebang. Am I missing something or does CGI::Application seem to fall short on the organizational level? Also, what is the standard (or several of the better ways) of using the run modes? For instance, to create a register function I have two choices, create a page template using one run mode to display and another to process it, or use the same run mode to display and process it determining which to do by watching which button was clicked (which seems to make the whole run mode idea pointless). But, while I run through my scratchpad of pieces to build, I find myself running the almost identical pattern for each fairly simple feature by writing: run mode to display, run mode to process, web template. After writing my third copy of that pattern I figured there must be a better way of handling requests for display / processing purposes in CGI::Application. Can anyone pop a kernel my way on how I can make better use of this package? I'm looking for more of an architectural-leveled answer, please. Thanks! John _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

