Re: returning array refs from Thread::Queue::AnyX

2002-10-28 Thread Elizabeth Mattijsen
At 11:14 AM 10/28/02 -1000, Joshua Hoblitt wrote: > That's exactly the problem: the @{} is forcing scalar context, so that it > tries to deref the value 1 always (which you'll see if you're using strict). I understand now... is there a pretty way to force the calling context? Using (...)[0] is c

Re: returning array refs from Thread::Queue::AnyX

2002-10-28 Thread Joshua Hoblitt
> That's exactly the problem: the @{} is forcing scalar context, so that it > tries to deref the value 1 always (which you'll see if you're using strict). I understand now... is there a pretty way to force the calling context? Using (...)[0] is causing errors for me. -J

Re: returning array refs from Thread::Queue::Any

2002-10-28 Thread Elizabeth Mattijsen
At 02:44 PM 10/27/02 -1000, Joshua Hoblitt wrote: -- use strict; sub myfunc { wantarray ? [1, 2] : 3; } my( $one, $two ) = @{ &myfunc }; print "$one, $two\n"; -- One would expect that to work but the context is getting lost. That's exactly the problem: the @{} is forcing scalar contex

Re: Thread::Queue::Any and sharing

2002-10-28 Thread Arthur Bergman
On fredag, okt 25, 2002, at 17:15 Europe/Stockholm, Ray Hilton wrote: This was under Linux 2.4.19, the reason for forking was the thread creation overhead. The theory being, create a pool of threads, and then fork() the process on each new socket connection, hopefully copying the thread pool t