I am getting error in the debug mode as below.

C:\Program Files\Apache Group\Apache\cgi-bin>perl -d test.cgi
Default die handler restored.

Loading DB routines from perl5db.pl version 1.07
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

[Fri Jan 11 15:00:50 2002] test.cgi: testapi.pm did not return a true value
at test.cgi line 3.
[Fri Jan 11 15:00:50 2002] test.cgi: BEGIN failed--compilation aborted at
test.cgi line 3.

The script is as below

#!/usr/bin/perl -w
push(@INC,'c:\program files/apache group/apache/cgi-bin');
use testapi;
my $webapp = tapp->new();
$webapp->run();


Changing the use to require with an absolute path didn't made any difference
and I got the same error. Any Ideas as why??


the testapi.pm is as below

Thanks

package tapp;
use base 'CGI::Application';
use strict;

   # Needed for our database connection
   use DBI;

   sub setup {
        my $self = shift;
        $self->start_mode('mode1');
        $self->run_modes(
                'mode1' => 'showform',
                'mode2' => 'showlist',
                'mode3' => 'showdetail'
        );

        # Connect to DBI database
        $self->param('mydbh' => DBI->connect());
   }

   sub teardown {
        my $self = shift;

        # Disconnect when we're done
        $self->param('mydbh')->disconnect();
   }

   sub showform {
        my $self = shift;

        # Get CGI query object
        my $q = $self->query();

        my $output = '';
        $output .= $q->start_html(-title => 'test Search Form');
        $output .= $q->start_form();
        $output .= $q->textfield(-name => 'testcode');
        $output .= $q->hidden(-name => 'rm', -value => 'mode2');
        $output .= $q->submit();
        $output .= $q->end_form();
        $output .= $q->end_html();

        return $output;
   }

   sub showlist {
        my $self = shift;

        # Get our database connection
        my $dbh = $self->param('mydbh');

        # Get CGI query object
        my $q = $self->query();
        my $testcode = $q->param("testcode");

        my $output = '';
        $output .= $q->start_html(-title => 'List of Matching tests');

        $output .= $q->end_html();

        return $output;
   }

   sub showdetail {
        my $self = shift;

        # Get our database connection
        my $dbh = $self->param('mydbh');

        # Get CGI query object
        my $q = $self->query();
        my $testid = $q->param("testid");

        my $output = '';
        $output .= $q->start_html(-title => 'test Detail');

        $output .= $q->end_html();

        return $output;
   }


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

Reply via email to