in reply to $threads->join() only returns one argument??? BUG?
I'm not sure if it counts as a bug, but I encountered the same thing and couldn't find anything in the docs that suggested it should or shouldn't be able to return a list.
The simplest solution I came up with was join the list on the return and split it at the other end.
use threads; my $t = threads->create( sub{ sleep 10; return join $;, 'fred', 1, 1.123 } ); print split $;, $t->join;
Usual caveats about choice of seperator apply. $; seems as good a choice as any for most things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: $threads->join() only returns one argument??? BUG?
by djantzen (Priest) on Jun 11, 2003 at 23:19 UTC | |
by BrowserUk (Patriarch) on Jun 11, 2003 at 23:41 UTC | |
by JamesNC (Chaplain) on Jun 12, 2003 at 03:00 UTC |