Re: Curious corner cases concerning closure cloning

2006-08-14 Thread Yuval Kogman
On Mon, Aug 14, 2006 at 16:01:47 +, Luke Palmer wrote: What do these do? Intuition based answers: for 1,2 { my $code = { my $x; BEGIN { $x = 42 } $x; }; say $code(); } I think the closure would be emitted equivalently to my $x = 42, or

Re: Curious corner cases concerning closure cloning

2006-08-14 Thread Jonathan Scott Duff
On Mon, Aug 14, 2006 at 04:01:47PM +, Luke Palmer wrote: What do these do? for 1,2 { my $code = { my $x; BEGIN { $x = 42 } $x; }; say $code(); } Assuming that variables are available immediately as they are parsed and that BEGIN blocks