Re: recursive closures?
From: Brian McCauley (nobull_at_mail.com)
Date: 12/15/03
- Next message: ko: "Re: Parsing delimiter-separated data."
- Previous message: Anno Siegel: "Re: Planning for maintenance"
- In reply to: Uri Guttman: "Re: recursive closures?"
- Next in thread: Uri Guttman: "Re: recursive closures?"
- Reply: Uri Guttman: "Re: recursive closures?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 15 Dec 2003 13:39:05 +0000
Uri Guttman <uri@stemsystems.com> writes:
> my $sub ;
> $sub = sub{ blah; $sub->() }
That leaks.
use Scalar::Util qw( weaken );
my $weak_sub;
my $sub = sub{ blah; $weak_sub->() }
weaken($weak_sub = $sub);
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
- Next message: ko: "Re: Parsing delimiter-separated data."
- Previous message: Anno Siegel: "Re: Planning for maintenance"
- In reply to: Uri Guttman: "Re: recursive closures?"
- Next in thread: Uri Guttman: "Re: recursive closures?"
- Reply: Uri Guttman: "Re: recursive closures?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]