good chemistry is complicated,
and a little bit messy -LW
using CGI::Application::Dispatch in my existing application
by punkish (Priest)
on Oct 29, 2008 at 16:21 UTC
I started looking for alternatives for cleaning up my web application URLs, and found CGI::Application::Dispatch . Except, I can’t, for the life of me, figure out how to graft in C::A::D into my existing application.
Update: Added words in emphasis to the above para. Without them the sentence didn’t make any sense.
Here is the background —
I have a reasonably mainstream application made with CGI::Application and a sprinkling of Plugins (DBH, Session, LogDispatch, AutoRunmode).
I follow the usual pattern —
Everything works, and now I want to clean up my URLs. Nothing fancy, just the usual stuff like so —
calls to “update” and “save” will be via POST, so they should be let in freely, and the same applies to all static content such as css, js, media, etc.
So, I started with mod_rewrite voodoo, but after 4 days of tackling it unsuccessfully, I have given up on it.
Even if I get everything working well with mod_rewrite, I am actually loathe to implement it, because in the long run, I want to do minimum amount of messing with Apache configs, something I may not have complete control over in different conditions. Keep in mind, I don’t mind implement a couple of mod_rewrite rules, but doing it in my application will give me more control for future development and modification.
So, I started looking for alternatives, and found CGI::Application::Dispatch . Except, I can’t, for the life of me, figure out how to graft in C::A::D into my existing application.
If I am being dense, just whack me on your head with your esc key. In any case, do guide me through this valley of confusion.
Once I figure it all out, I will write up a nice easy tutorial that even PHP folks will be able to understand. Promise.
Update: and, yes, I have looked at all the CGI::App::Dispatch articles that I could find. While they do explain stuff, they don’t explain it in context of implementing CAD within and existing CGI::App application. At least, not in the way I could understand.
Update2: and, I need to do with vanilla cgi first, before I attempt all the CAD magic with mod_perl
Seekers of Perl Wisdom
PerlMonks somehow became entangled with
The Perl Foundation .
Marvelous Managed Hosting and Bandwidth Generously Provided by
Built with the Perl programming language .