Newbie to Earth! What am I doing wrong? I don't see the difference between my
module and the Widgets example included in CGI::Application docs.

Am I failing to fulfill any preconditions? What modules do I need to keep
running into Apache? How can I know which modules are? Is mod_perl required?

Package Bla;
use base 'CGI::Application';
use strict;
use DBI;

I had a setup() doing this, then took it off, then drop it back in:

        $self->param('DBH'=>'');
        
I have no teardown() implemented. If the user logs in successfully,
then I do

        $self->param('BASE' => $q->param('base'));
        $self->param('USER' => $q->param('user'));
        $self->param('PASS' => $q->param('pass'));
        my $dsrc = "DBI:mysql:".$self->param('BASE');
        $self->param('DBH' => DBI->connect($dsrc,
                        $self->param('USER'),
                        $self->param('PASS'),
                        {RaiseError=>1}));

Then I present a menu along with some statistics from the database,
all of which works (that is, the connect() has succeeded).
I understand DBH is now a persistent parameter (as per my $self->param()), 
// IS THIS RIGHT?
 but as soon as the user chooses anything from the menu, passing
to another runmode, this fails miserably:

        my $dbh = $self->param('DBH');
        my $sql = "bla";
        my $sth = $dbh->prepare($sql) || return $DBI::errstr;

My debugging console says:
 Can't call method "prepare" without a package or object reference at ...

I seem to be heavily misunderstanding something. Please help! TIA
-- 
Eduardo Grosclaude                  [EMAIL PROTECTED]
Universidad Nacional del Comahue - Neuquen, Argentina

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to