perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew O'Brien" <andr...@oriel.com.au>
Subject RE: Execute question
Date Wed, 20 Apr 2005 23:47:30 GMT

Allen,

That's all up to how you structure your page construction. You will need
to either

1. Easier: be able to test for that branch condition early enough in
your page
   construction and then have the two Execute()s in a wrapping "if"
statement
Or
2. take advantage of the fact that Execute can put its output into a
scalar and
   you can pass back information either via scalar reference parameters
or via
   the errors option to Execute. Contrived example:

page.epl:
...
[-
  $req = shift;
  my $do_something_else = 0;
  $out = '';
  Execute({inputfile => 'page_that_can_return_errors.epl',
           output => \$out,
           param => [\$do_something_else]
          });
  if ( $do_something_else ) {
    Execute( 'alternative_content.epl' );
  } else {
    local $escmode=0;
    print OUT $out;
  }
-]

Page_that_can_return_errors.epl:
[-
  $req = shift;
  $test = shift @param;
  if ($something_went_wrong) {
    $$test = 1;
    exit;
  }
-]

-- 
Andrew O'Brien
Development Manager
e: andrewo@oriel.com.au    p: +61 2 9461 0114
w: www.oriel.com.au        f: +61 2 9431 6700 

> -----Original Message-----
> From: allen haim [mailto:allen@netherrealm.net] 
> Sent: Thursday, 21 April 2005 7:00 AM
> To: embperl@perl.apache.org
> Subject: Execute question
> 
> Hi,
> 
> How do I abort the flow of my current Embperl page and bring 
> up a different
> Embperl page?
> 
> If I use Execute, it puts the other page inside the calling 
> page, but I
> would like to discard the calling page entirely and just 
> bring up the new
> page.
> 
> Do I use Execute for this or something else?
> 
> Thanks,
> 
> Allen
> 
> 
> -- 
> happy random george orwell advice for making tea:
> 
> 	Some people would answer that they don't like tea in 
> itself, that they only drink it in order to be warmed and 
> stimulated, and they need sugar to take the taste away.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message