$buf = <$s>; # Try to read a line print "$buf"; # Was there anyone on the other end? if (( defined $buf ) || ($buf =~ /\w/)) {