As I all ready have experience with CGI::Application and HTML::Template and I wanted to use those for creating web applications. Both are simple and can simply be copied into the application folder and things work - no hassle (that's another reason for using it).

Problem I'm now facing is that instead of putting several run modes in one file, I need several files also.

Maybe this would be clear with an example. Say it's an mailing list application. Naturally I want to place all the subscribers administration code in one place, newsletter admin in other place ... where place = module.

Some time ago (like a year passed) I started working on that mailing list application with CGI::App as framework but due to inexperience and lack of time I made it somewhat complicated - well not nice at least. I stopped working on it (~ 85% of it finished) because it was canceled (freelance project) and now I'm thinking to use it as my university project and/or dissertation from e-business ;)

Did anybody used CGI::App for things like that? Maybe some other framework - but for latter as I dint have time to learn new things now.

After thinking for some time I believe I came up with an elegant solution but would like any comments on it.

Basically there in only one index.pl file. That is the entry point to application (or website).
It will be a sort of dispatcher since you could call it with .../index.pl/subscribers/ and itself would require subscribers; (or maybe even several levels deep : index.pl/admin/subscribers for instance) and then folow the rest of plain CGI::App index file (create an object and call run method).

All those modules of application would be child's of some main application module. That main module would have code for authorization/authentication, sessions, reading in config files, connecting to DB ....
And it would be a child of CGI::App (use base 'CGI::Application') or probably that extension for automatic settings of run modes.

Is logic OK here?

I also wonder about few things:

Thanks folks.

In reply to CGI::Application for complex web applications? by techcode

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.