in reply to Re: Anyone have experience with CGI::Application ?
in thread Anyone have experience with CGI::Application ?

Yes.. Well.. Obviously this is a web app, and has many "states" - or .. "runmodes".

I had all of them coded into one cgi at one point, but found it much neater to organize into sepparate cgis, they are all tiny scripts, as the bulk of it lies in modules.

But now I have like 40 cgis and it's looking mediocre.. ? So.. I considered consolidating some of them, then.. I wonder if I should use CGI::Application- It seems maybe- I could offer parts of this as addons... to CGI::Application? It seems someone made an image gallery.. etc..

I have a web app that lets computer illiterates manage files, directories, users, and access to all three.

  • Comment on Re^2: Anyone have experience with CGI::Application ?

Replies are listed 'Best First'.
Re^3: Anyone have experience with CGI::Application ?
by derby (Abbot) on May 31, 2006 at 15:59 UTC

    There's nothing inherently wrong with having 40 cgis and CGI::Application supports that. Sure, the cgi is quite simplistic:

    use strict; use My::CGI::Application::App; my $app = My::CGI::Application::App->new(); $app->start_mode( 'run_mode_that_matches_cgi_name' ); $app->run();
    That way you can have distinct namespaces for the modes of your app --- think /cgi-bin/search, /cgi-bin/results, /cgi-bin/display ... that's a bit better (IMHO) than /cgi-bin/app?mode=search, /cgi-bin/app?mode=results, /cgi-bin/app?mode=display. Sure under the covers it's all the same thing but having that clean namespace can be a blessing when you wish to have some special handler for a particular runmode (the handler can then sit on top of the namespace ala modperl instead of being integrated into the app).

    -derby
Re^3: Anyone have experience with CGI::Application ?
by Asim (Hermit) on May 31, 2006 at 16:04 UTC
    they are all tiny scripts, as the bulk of it lies in modules.

    Coolness! For something like that, yes, CGI::Application makes a great deal of sense. Since you've already done most of the refactoring work, you should have a win with using runmodes over a hand-rolled calling solution, in the long run.

    Plus, it makes it easier to pass auth or other data, which can help tie your application together. That's a win, and I think your instincts are dead on.

    ----Asim, known to some as Woodrow.