in reply to Re: Re: CGI::Application, have I made a big mistake.
in thread CGI::Application, have I made a big mistake.

I am eager to try out the various ideas concerning subclassing an entire CGI:App. I'm doing a "lite" version of this on my project. On our web server we have a common piece of infrastructure that limits user access depending on dir location. There is a piece of my application that I want two different sets of users to have access to. So I set up this scheme:

MyApp.pm (off somewhere outside of the document root) doc-root--- -------------- | | foo_dir bar_dir | | foo.cgi foo.cgi Code for foo.cgi: use MyApp; my $webapp = MyApp->new(); $webapp->run();

Each use the same MyApp.pm, but access to the foo_dir is limited to different users than bar_dir.

This approach has the advantage of using the existing login/ authentication scheme while allowing me to reuse my code across different locations.

One thing worth noting, is that I haven't taken advantage of CGI:Apps ability to pass in different parameters so that the same MyApp code could behave somewhat differently in these two instances.

good luck with your project.

-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday