Selling cookie info to third-parties is a classic example of you can make money without doing evil.
RSS

CGI::Application::Plugin::BREAD

2005/07/23 filed under /perl

One of the things I really dislike, is the never ending admin panel that is always required by freelance programming projects. The user always wants to edit his/her database by some easy interface. It's not all that hard to create, yet painfully boring.

I was relieved to find Class::DBI, making this boring job a little easier, for you can forget about the silly INSERT, UPDATE and DELETE SQL commands. Yet you still have to write a lot of code to put it all together.

Jason Purdy now created CGI::Application::Plugin::BREAD, which is supposed to make all of this even easier.

BREAD is -of course- an acronym, that stands for Browse, Read, Edit, Add, and Delete, exactly what we wanted!

It's still an alpha release, yet it's already very promising! Just try this application and see for yourself. First you'll need the package:

package MyBREADApp;

use base 'CGI::Application';
use CGI::Application::Plugin::BREAD qw( bread_db );
use Class::DBI::Loader;

sub setup
{
  $self = shift;
  my $loader = Class::DBI::Loader->new(
          dsn                     => "dbi:mysql:mysql",
          user                    => "webuser",
          password                => "webpass",
          namespace               => "WHATEVER",
          relationships           => 1,
          additional_classes      => [ 'Class::DBI::FormBuilder' ],
      );
  $self->bread_db( $loader );
}

After that, you'll make the cgi, like this

#!/usr/bin/perl -w
use MyBREADApp;

my $webapp = MyBREADApp->new();
$webapp->run();

Point your browser to the freshly created cgi script and be ready to be amazed. This is really all code necessary to do all described above.

As stated above, it's still an alpha release, so don't use this in production environments (yet). In the future, templating options will be added, making this truly a killer module.

Posted by: B10m | permanent link | comments (0)
Comments are closed for this story.
Trackbacks are closed for this story.
return-member