Jerry D. Hedden wrote:
> I think it would be simpler just to have an ->err() method
> that could be called after (or even before) a thread is
> joined:
>
>     my $result = $thr->join();
>     if ($thr->err()) {
>         die('Thread error: ' . $thr->err());
>     }

Eric Rybski wrote:
> That sounds pretty good.  One thing to watch for is that
> blessed references can also be propagated by $thr->err(),
> so OO results (like those returned by Exception::Class and
> Error) will survive the trip across threads.

I just uploaded 'threads' v1.54 to CPAN.  The new method
name is ->error(), and it does handle exception objects.
This latter part was tricky because objects normally can't
be returned by threads.  (That was a shock to me when I was
told about it.  It wasn't in the POD, so I added it.)

Reply via email to