So I went ahead and released ::ValidateRM under the ::Plugin::ValidateRM
name space.

On the heels of that, I developed another plugin for easier management
of DBI database handles. I think it's worth using for nearly all database
applications with CGI::App because:

 - It's dead simple to use. 

 - It uses lazy loading, which means a database connection is never actually
   made if you don't use the handle. This means you configure a database
   connection globally in a superclass, and not worry about the overhead
   for run modes that don't use it. 

I just thought of a update I should make for the next version: I should
credit Cees, whose CGI::Application::Session cod inspired my work on
this.

######

SYNOPSIS
    use CGI::Application::Plugin::DBH (qw/dbh_config dbh/);

    sub cgiapp_init  {
       my $self = shift;

       # use the same args as DBI->connect();
       $self->dbh_config($data_source, $username, $auth, \%attr);
    }

    sub my_run_mode {
       my $self = shift;

       my $date = $self->dbh->selectrow_array("SELECT CURRENT_DATE");

       # OR ...

       my $dbh = $self->dbh;
       my $date = $dbh->selectrow_array("SELECT CURRENT_DATE");

    }

DESCRIPTION
       CGI::Application::Plugin::DBH adds easy access to a DBI database handle
       to your CGI::Application modules.  Lazy loading is used to prevent a
       database connection from being made if the "dbh" method is not called
       during the request.  In other words, the database connection is not
       created until it is actually needed.

Full Docs:
http://mark.stosberg.com/perl/dbh.html

Download:
http://mark.stosberg.com/perl/CGI-Application-Plugin-DBH-0.01.tar.gz



        Mark

-- 
http://mark.stosberg.com/ 


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to