Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm creating a server in Perl, and I'm trying to make a hash with all clients that are connected to the server. For practical purposes, I'm setting the IO::Socket::INET object, as returned by new() as key of the hashe. So, I can add refhashes like $clients->{$socket}->{transferedBytes} += 10.
The problem is: how can I access, say, the foo method from the object? In a foreach loop (foreach (keys %{$clients})), how can I access either the methods from IO::Socket::INET on $_ and my defined $_->{transferedBytes}?
I hope you can understand my doubt. An advice on how I could store sockets on hashes/arrays would be nice.
Thanks a lot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash of IO::Socket::INET objects
by sacked (Hermit) on Jul 09, 2004 at 18:16 UTC |