sub new { my $class = shift; my $arg = shift; ## What is $arg? Why is it never used? # share (my %this); ## this is an obfuscated way to share a variable my %this :shared; ## the correct way $this{_socket} = shift; ## Presumably this is the socket? Is this where you get the error? $this{_sendBufferCount} = 0; ## bless \%this, $class; ## bless returns the blessed reference; you are throwing it away ## return \%this; ## this returns an unblessed reference to the hash -- no good for OO. ## Do it this way. return bless \%this, $class; }