A better way to do this would be to call the subroutine directly as a
result of the conditional.

i.e.
.
.
.
if($valid){
   return($self->thanks());
}else{
   return($self->error());
}
.
.
.


   (dk)


--
you know there isn't much i have to say
that i wouldn't rather just shut up and do

d.o.r.l.a.n.d.o
...k.e.i.s.e...

On Mon, 12 Nov 2001, Benjamin wrote:

> Hi,
>
> > if (valid)
> > {
> >   $q->param('rm', 'thanks');
> > }
> > else
> > {
> >   $q->param('rm', 'error');
> > }
> > return;
> >
> > ...but this just prints out the word thanks or error.
>
> This can't work, because the Run Mode Subroutine is already chosen, and
> therefore setting the 'rm'-param won't change the further program flow.
> One solution to your problem could be a redirect to an appropriate Run
> Mode
>
> if (valid) {
>       $q->header_type('redirect');
>       $q->header_props(-uri=>'http://yoursite.com/sourscript.pl?rm=thanks');
> }
> else {
>       $q->header_type('redirect');
>       $q->header_props(-uri=>'http://yoursite.com/sourscript.pl?rm=error');
> }
>
> Hope this helps
>
> Benjamin
>
> --
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GIT/P dx s: a? C(+++) L++ P+++ N++ w PS+ PE-(++) Y+ PGP
> t+ 5- X R@ !tv b+++ DI(+) D+ G e++(+++) UF++ h-- r@ y?
> ------END GEEK CODE BLOCK------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to