use A; sub new { $class = shift; my $self = { .... }; bless $self; return $self ; } sub initServer { # starts the server using IO::Socket::INET ## accepts the connection if ($socket readable) { $guimodule->changeGui(); } } 1;