develooper Front page | perl.perl6.language | Postings from August 2001

RE: explicitly declare closures???

Thread Previous | Thread Next
From:
Garrett Goebel
Date:
August 28, 2001 08:01
Subject:
RE: explicitly declare closures???
Message ID:
71BEC0D4E1DED3118F7A009027B12028010BDFF5@EXCH_MISSION
From: Ken Fox [mailto:kfox@vulpes.com]
> 
> > You forgot the other example that someone raised:
> > 
> > { my $x = 'X'; *h = sub { $H = sub {pr $h} }}
> > h(); $H->();
> > 
> > Which prints:
> > 
> > Z
> 
> Did you mean this?
> 
> { my $z = 'Z'; *h = sub { $H = sub {pr $z} }}
> h(); $H->();
> 
> Then I agree.

Yes, my example was one cut and paste too early...

;)

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