Instead of doing the eval 99999 times, how about
my $per_thread_closure_maker = eval <<' CLOSURE_HACK'; sub { my ($warns) = @_; return sub { push @$warns, @_ }; }; CLOSURE_HACK for my $j (1..99999) { my @warns; { local $^W = 1; local $SIG{"__WARN__"} = &$per_thread_closure_maker(\@warns); } }
In reply to Re: Replacing closures (to work around threads crash)
by ikegami
in thread Replacing closures (to work around threads crash)
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |