swiftone has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to use these as hash keys? For example:
(I've tried it, and -w and use strict don't complain, but my script isn't working overall...I can't tell if this is due to my lack of sockets comprehension, or this trick.)@readable_handles=$selectobj->can_read(0.1); foreach my $socket (@readable_handles) { $sockethash{$socket}->{readable}=1; } # other places in the program can identify which # connection is being discussed by using the connection # handle as a hash key
If this doesn't work, is there an easy way to identify what socket you are dealing with?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sockets/filehandles as hash key?
by lhoward (Vicar) on Sep 11, 2000 at 18:23 UTC | |
by swiftone (Curate) on Sep 11, 2000 at 20:33 UTC | |
|
Re: Sockets/filehandles as hash key?
by merlyn (Sage) on Sep 11, 2000 at 18:28 UTC | |
|
Re: Sockets/filehandles as hash key?
by lhoward (Vicar) on Sep 11, 2000 at 18:23 UTC | |
|
RE: Sockets/filehandles as hash key?
by Fastolfe (Vicar) on Sep 12, 2000 at 01:11 UTC |