bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
Am brand new to CGI::Application and have run into a problem where it is not performing a subroutine from within one of the run modes. I've stripped it down to the basics. Here's my main.
#!/usr/local/bin/perl use lib "../cgi-bin/cgiwrap/dsoft/"; use strict; use DSAdmin_test; my $dsadmin = DSAdmin_test->new(); $dsadmin->run();
And my application:
#DSAdmin package DSAdmin_test; use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; use base 'CGI::Application'; #------------------------ redirection ------------------------ sub setup { my $self = shift; $self->mode_param('rm'); $self->run_modes( 'ss' => 'save_subsrbr', ); } sub save_subsrbr { my @errors = qw(incorrect wrong); if (@errors) { errorhandler (\@errors); return "here2: " . Dumper(@errors); } } sub errorhandler { my $errors = shift; return "here1: " . Dumper($errors); } 1;
"here2" is printing but it's not going to "here1" first! When I run the subroutines as regular Perl scripts, it works fine. What am I not getting? Thanks in advance.
—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI::Application and subroutines
by BUU (Prior) on Dec 10, 2005 at 23:10 UTC | |
by bradcathey (Prior) on Dec 11, 2005 at 05:55 UTC | |
by Kanji (Parson) on Dec 11, 2005 at 07:52 UTC | |
Re: CGI::Application and subroutines
by johnnywang (Priest) on Dec 11, 2005 at 07:42 UTC | |
by bradcathey (Prior) on Dec 11, 2005 at 18:37 UTC |
Back to
Seekers of Perl Wisdom