Damian Conway <[EMAIL PROTECTED]> writes:

> Larry explained:
>
>> : Umm..... didn't you say bare blocks were going away?
>> 
>> Rule #2 was invoked.
>> 
>> The current thinking is that any bare block will never be interpreted
>> as returning a closure.  You have to use explicit C<return {}> or C<sub {}>
>> to return a closure.
>
> Or the equivalent of a C<sub {}>, namely:
>
>       $closure = -> {...};
>
> or:
>
>       $closure = { $^has_a_placeholder_variable };
>
>
> Or an explicit closure context:
>
>       sub foo(&closure) {...};
>
>       foo { this_block_is_a_closure() };

The closure is going to close over all the variables currently in
scope isn't it? Not just the immediately containing scope.

-- 
Piers

   "It is a truth universally acknowledged that a language in
    possession of a rich syntax must be in need of a rewrite."
         -- Jane Austen?

Reply via email to