I have to admit I don't understand the logic flow of your framework in detail, but I think what you want can be accomplished with CGI::Application::Dispatch. To make it work, you'd split up your web app into many smaller cgiapp modules, and route to them through the URL.

For our photo gallery site, we use this approach, and it works very well. As an example, I have the following classes:

EM::UI::Admin::Layout EM::UI::Admin::Report EM::UI::Admin::Upload
and my dispatch table looks something like this:
CGI::Application::Dispatch->dispatch( table => [ # admin apps '/admin' => { app => 'EM::UI::Admin', rm => 'ove +rview' }, '/admin/:app/:rm/:id?' => { prefix => 'EM::UI::Admin' }, # general public apps ':app/:rm/:id?' => { prefix => 'EM::UI::Public' }, ], );
That way, a url like http://example.com/admin/layout/overview would get dispatched to the "overview" run mode in EM::UI::Admin::Layout.

The advantage of this approach is that I can simply drop in a new cgiapp class with new functionality, and it will work out of the box. It also helps with maintenance, since the classes are generally fairly small, and only contain code related to a single feature.

Some other plugins you may want to look into - in case you don't know of them yet - are:

There are a lot more plugins, but these are the ones that help me the most in building scalable and maintainable web apps with CGI::Application.

In reply to Re: CGI::App dynamic runmodes/modules by rhesa
in thread CGI::App dynamic runmodes/modules by Ryszard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.