sub getServer { [...] return new Server($serverId); [...] } %g_servers = (); $g_servers{$s_addr} = &getServer($s_peerhost, $s_peerport);