Invalid value for shared scalar

Invalid value for shared scalar

am 14.06.2005 09:27:20 von Bhaskar

Hi,

I am doing multithreaded programming in perl involving sockets.

I am using a IO::Select variable as a shared variable.

I am declaring it as..

use threads;
use threads::shared;

my $write_set : shared;

$write_set = new IO::Select();


I will be using this to keep a list of connected client's sockets.

I have a thread which will be accepting for client connections.
So, in the thread ,when i get a client's request connection,
i try to add socket handle to $write_set.

$write_set->add($new_sock);

The following error is coming.

Invalid value for shared scalar at abc.pl line 63.

Can any one help me on this regard.