In article <[EMAIL PROTECTED]>, Irubin Consulting wrote:
> Hello,
> 
> I am trying to execute some code in the cgiapp_prerun subroutine, and it is
> not being executed. Here is the code:
> 
> sub setup {
> 
>    my $self = shift;
>     $self->start_mode('out');
>     $self->mode_param('action');
>     $self->run_modes(
>             'add_system'      => \&add_system,
>             'delete_system'   => \&delete_system,
> 
>     );
>     $self->param('config' =>  AppAdminConfig->new());
>     $config = $self->param('config');
>     $self->param('dbh' => DBI->connect($config->get_dsn,
> $config->get_user_name, $config->get_password));
> 
> }
> 
> sub cgiapp_prerun {
>       my $self = shift;
>       my $q = $self->query();
>       $ID = $q->cookie('ID');
>       if (!$ID) {
>               $thtml = $self->load_tmpl($config->get_base_template_path .
> $config->get_admin_login, die_on_bad_params => 0);
>               return $thtml->output;
>       }
> }

Roy,

You are returning HTML from cgiapp_prerun, but nothing is being done
with it, as you might expect. If you want to return some HTML from
cgiapp_prerun, the way to do that is to change the current run mode. To
do that, see the documentation for prerun_mode().

You may also be interested in learning to use the perl debugger:

perl -d your_script.cgi

Then you can step through a troublesome script interactively, and verify
with some degree of conclusiveness what path of logic is being followed
with the code, and check particular values while your script executes.


        Mark

--
http://mark.stosberg.com/ 


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to