in reply to threads->join
The context (scalar or list) of the thread creation is also the context for join(). This means that if you intend to return an array from a thread, you must use "my ($thread) = threads-"new(...)>, and that if you intend to return a scalar, you must use "my $thread = ...".
Applied to your example, this would mean:
($thr) = threads->new(\&sub1);
Liz
Update:
Apparently the above documentation is in 5.8.1, and not in 5.8.0. I guess you could say it's one more documentation bug that was fixed by 5.8.1. Sorry for the possible confusion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: threads->join
by powerman (Friar) on Oct 05, 2003 at 22:53 UTC |