[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] problem with prerun_mode()


Hi *,

I tried to find a solution for my problem in the history of the list,
but didn't get anything.
When I modify the runmode within cgiapp_prerun using the prerun_mode
function, it seems that the query object somehow gets destroyed or at
least doesn't contain the previous params, when entering this new
runmode function.
At the beginning of cgiapp_prerun I loop through all the params of the
CGI object and find them all set to the proper values. At the beginning
of the function the new runmode points to, all of my params seem to be
gone.

------------------------< snip snip snip >-----------------------------
sub cgiapp_prerun {

  my( $self ) = shift;
  my( $TEST ) = $self->param( "TEST" );
  my( $oCGI, %hParams, $k );

  $oCGI = $self->query();
  %hParams = $oCGI->Vars();

  if( $TEST > 0 ) {
    for $k ( sort keys %hParams ) {
      # MsgCGI is logging to a file
      # -> all params are logged with their correct values
      &MsgCGI( TRUE, 1, ">" . $k . "< >" . $hParams{ $k } . "<\n" );
    }
  }

  if( <some condition> ) {
    $self->prerun_mode( "modeadd" );
    &MsgCGI( TRUE, 1, "switched runmode to >modeadd<\n" )
      if( $TEST > 0 );
  }

}

sub modeaddfkt {

  my( $self ) = shift;
  my( $TEST ) = $self->param( "TEST" );
  my( $oCGI, %hParams, $k );

  $oCGI = $self->query();
  %hParams = $oCGI->Vars();

  if( $TEST > 0 ) {
    for $k ( sort keys %hParams ) {
      # -> all params are logged as empty
      &MsgCGI( TRUE, 1, ">" . $k . "< >" . $hParams{ $k } . "<\n" );
    }
  }

}
------------------------< snip snip snip >-----------------------------

Maybe I don't understand this thing completely, but if anybody could
give me a hint in the right direction ...

TIA.

Bye.
Michael.
-- 
Michael Hirmke            | Telefon +49 (911) 557999
Wilhelm-Spaeth-Strasse 52 | FAX     +49 (911) 557664
90461 Nuernberg           | E-Mail  mailto:suppressed
                          | WWW     http://www.hirmke.de/

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.