my ($sets) = IO::Select->select($socket_set, undef, undef, 0); ... foreach (@$sets) { $buf = <$_>; if($buf) { if($buf =~ "^VIEWLOG") { ...