I'm getting these errors thrown by the CGI::Application::run() method:
No such run mode 'start' at /var/wwwssl/auth-test/dprnew.cgi line 6 (i
+n cleanup) Can't access `DESTROY' field in object of class D +istroPr
+sRls. at /var/wwwssl/auth-test/dprnew.cgi line 0
dprnew.cgi reads:
#!/usr/bin/perl -wT
use lib(qw{/home/hesco/sandbox/DistroPrsRls/lib});
use DistroPrsRls;
BEGIN { print STDERR "\@INC includes: \n", join("\n", @INC), "\n"; }
my $dpr = DistroPrsRls->new();
$dpr->run();
exit;
1;
My DistroPrsRls.pm calls DistroPrsRlsAuth.pm which includes a use base CGI::Application; line. It starts out:
package DistroPrsRls;
use Carp;
use lib(qw{/home/hesco/sandbox/DistroPrsRls/lib});
use base 'DistroPrsRlsAuth';
sub setup {
my $self = shift;
$self->start_mode('mode1');
$self->mode_param('rm');
$self->run_modes(
'mode1' => 'Login',
'mode2' => 'DPR_Dashboard',
'mode3' => 'EnterPrsRls',
'mode4' => 'ApprovePrsRls',
'mode5' => 'ChooseLists',
'mode6' => 'ScheduleDistro',
'mode7' => 'AuthorizeDistro',
'mode8' => 'ReviewJobs' );
return 1;
}
sub Login {
my $self = shift;
my $q = $self->query();
$output .= $q->start_html(-title => 'DistroPrsRls Login Form');
$output .= h3('Login Page'),br();
$output .= "$error \n" if defined($error);
$output .= $q->startform();
$output .= $q->textfield(-name => 'testfield');
$output .= $q->password(-name => 'testpassword');
$output .= qq{UserID: <input type="text" name="username" size=15><b
+r>};
$output .= qq{Password: <input type="password" name="password" size=
+15><br>};
# $output .= qq{<input type="hidden" name="function" value="Login">}
+;
$output .= $q->hidden(-name => 'rm', -value => 'DPR-Dashboard');
# $output .= qq{<input type="submit" value="Login">};
$output .= $q->submit(-value => 'Login');
$output .= $q->end_form();
$output .= $q->end_html;
return($output);
}
etc., etc.
Do I need to name one of the keys or values from the run_modes hash, 'start' to make this module work for me?
Thanks for your help.
-- Hugh