develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24250] "return" required in some anonymous closures

From:
Mark Jason Dominus
Date:
October 20, 2003 05:57
Subject:
Re: [perl #24250] "return" required in some anonymous closures
Message ID:
20031020125805.18455.qmail@plover.com
Dave Mitchell <davem@fdgroup.com>:
> This isn't a bug, it's a feature :-)
> 
> sub () {$lexical} is a constant sub generator, ie each call to 'sub'
> returns a new constant sub rather than a closure. 

Oh well, so much for the principle of least astonishment.

What's the workaround for this feature?




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