You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Brat Wizard <br...@naxs.com> on 2001/10/18 02:11:54 UTC
How to Abandon an Included File w/o Terminating Script???
Hi there-
Does anyone know how I can abandon further execution of an _included
file_ without necessarily terminating execution of the script itself?
I want to do something like this:
----- toplevel script ------
...(commands)...
$Response->Include("somefile.asp");
...(more commands)...
----- somefile.asp -----
...(do some stuff)...
if ($do_I_want_to_quit_now == true) {
don't_execute_this_included_file_anymore();
}
...(more commands)...
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: How to Abandon an Included File w/o Terminating Script???
Posted by Joshua Chamas <jo...@chamas.com>.
Brat Wizard wrote:
>
> Hi there-
>
> Does anyone know how I can abandon further execution of an _included
> file_ without necessarily terminating execution of the script itself?
>
> I want to do something like this:
>
> ----- toplevel script ------
> ...(commands)...
> $Response->Include("somefile.asp");
> ...(more commands)...
>
> ----- somefile.asp -----
> ...(do some stuff)...
> if ($do_I_want_to_quit_now == true) {
> don't_execute_this_included_file_anymore();
> }
Just return() from the include. In this way and
others, includes called via $Response->Include() are
like subroutines ( they are actually ). You may also return
values from includes, and pass @arguments into them.
--Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks Founder Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org