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.
In reply to CGI::Application and subroutines by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |