Ken Williams wrote:

> Stas Bekman <[EMAIL PROTECTED]> wrote:
> 
>> On Sat, 8 Sep 2001, raptor wrote:
>>
>>> my $eval = join ( '', qq{
>>>      package $package;
>>>      my $request;
>>>      START:
>>>      use Apache qw(exit);
>>>      $usercode
>>>      sub handler {
>>>           $package::request = \$r;
>>>           goto START;
>>>      };
>>> };
>>
>>
>> Hmm, that's an interesting idea. goto() can be very useful at times,
>> even if it's considered evil. Your solution seems to be too easy :)
>> Gotta go to sleep on it and see if there are some hidden issues with it.
> 
> 
> I usually like to use a labeled 'next' or 'last' instead of the 'goto':
> 
> my $eval = qq{
>      package $package;
>      my $request;
>      REQUEST: {
>          use Apache qw(exit);
>          $usercode
>          sub handler {
>              $package::request = \$r;
>              next REQUEST;
>          }
>      }
> };
> 
> (I haven't followed this thread, so I don't know what the larger problem
> is that you're solving.)


That's the root of the problem -- we are trying to solve the problem 
with nested named subroutines which create the closure effect. So as 
long as you create a block we get back to the same point we started from :

sub handler{} that wraps everything into a block :)




_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



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

Reply via email to