Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of grep (3333)

Thursday May 15, 2003
01:58 PM

CGI::App, Class::DBI, and mod_perl

[ #12222 ]
I just finished my Mother's Website on Sunday. Hopefully a nice Mother's day present.

This was my first foray into CGI::App and my first heavy use Class::DBI and mod_perl. Even with the learning curve of all 3 of these major modules, all I can say is they are incredibly easy to use and speed development tremendously. (I also used Template Toolkit, which was a joy. I just wrote one method that takes care of inserting sessions and returning the TT page).

CGI::App hides about everything complicated you need to know about mod_perl, it pretty much forces you to write good code, and it makes testing simple. The CGI::App framework is mod_perl friendly so just writing a CGI::App program almost ensures mod_perl will like it. I also appreciated tests quite a bit more with CGI::App. I was able to separate my display methods from my internal methods. I could code most all my unit tests without parsing HTML or restarting Apache.

Class::DBI not only kept my SQL down to a minimum, but also my perl. The intrinsic C::DBI method chaining is so convenient $session->cart->items.

I spent about 50 hours on the site, which I most likely would never have finished if I coded it as a straight CGI app. Then add the speed factor from mod_perl and C::DBI/Apache::DBI's persistent shared connections and I'm sold. (Don't be fooled visiting the site and it's a little slow right now I'm on a slow line 128k DSL, it's moving to Sprocket Data).

On a piscatorial note:
I just got back from Tarpon fishing in Costa Rica I would highly recommend it to anyone as a stress reliever. Tarpon (Silver Kings) have been celebrated for years as one of the best Saltwater fish (especially Hemingway) and it was great battling them. My big fish was 110 lbs. and took me 1 hr 15 mins to land. Don't worry it's all catch and release, not that you would want to kill a great creature like a tarpon.

So much better to battle a tarpon than your code :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Server error!

            The server encountered an internal error and was unable to complete your request.

            Error message:
            Error executing run mode 'home_page': DBD::Pg::st execute failed: no connection to the server [for statement `` SELECT featured_id FROM featured ORDER BY date_started DESC LIMIT 1; '']) at /usr/lib/perl5/site_perl/5.8.0/Ima/ line 736.

            If you think this is a server error, please c