develooper Front page | perl.perl6.language | Postings from June 2005

Re: How much do we close over?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 12, 2005 16:26
Subject:
Re: How much do we close over?
Message ID:
20050612232635.GC4809@iabyn.com
On Sun, Jun 12, 2005 at 06:22:22PM -0500, Rod Adams wrote:
> Well, you could always do something like:
> 
>    sub foo { my $x = 1; return sub {my $x := $OUTER::x; eval $^codestring} }

In perl5, that would just be

    sub foo { my $x = 1; return sub { $x ; eval $_[0]} }

-- 
You live and learn (although usually you just live).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About