package PKG1; sub New { my($port, $ipadd) = @_; : : my $self = { ipaddress => $ipadd, port => $to_port, }; bless($self, $class); } sub Start { my ($self) = @_; my $tid = threads->new(\&threadFunc); $tid->join(); } sub threadFunc{ my($self) = @_; my($port, $ip); $ip = $self->{ipaddress}; $port = $self->{port}; } 1;