Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Replacing closures (to work around threads crash)

by ikegami (Pope)
on Nov 22, 2004 at 05:31 UTC ( #409489=note: print w/replies, xml ) Need Help??


in reply to Replacing closures (to work around threads crash)

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); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://409489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2019-10-19 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?