for my $fh ($sel->can_read()) { if ($fh == $SERVER) { print "client connected\n"; } ... } #### for (keys(%hash)) { if ($fh == $_) { ... } }