this code gives me the error - Argument to share needs to be passed as ref. Am I doing something stupid or is it not possible to share a socket between threads. Thanks.package Foo; use threads; use threads::shared; sub new { my $class = shift; my $self : shared; $self = &share({}); $self->{socket} = &share(new IO::Socket::INET ( PeerAddr => $self->{ipAddress}, PeerPort => $self->{port}, Proto => 'tcp' )); bless $self, $class; return $self
In reply to Sharing sockets between threads by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |