Robert Rendler wrote: > Over the long haul I've made a couple of programs that use sockets > but still I don't understand to very basics of it yet. That is how to > properly send and receive the data. So far what I have been doing is > thus: > > $client = IO::Socket::INET->new('server');
That can't work. You need a port at least. Where are you checking for failed connection? Do you have "use strict" and -w in your program. > > while (<$client>) { > chomp; > next unless $_; > .... > > But doing it that way I sometimes have weirdness where I receive > nothing yet the 'next unless' statement doesn't catch it for some > reason. By "receive nothing", I assume you mean receive an empty line terminated by \n (or whatever you have $/ set to). For the next to happen, $_ must contain (after chomping) either '' (empty string), or '0' (a single zero). If $_ contains anything else (including any amount of whitespace), $_ will be considered "true" and the next will not execute. So, tell us exactly what is in $_ that you think should trigger "next" but doesn't. > For sending I usually just print to the $client variable like > a filehandle. That's fine. > I'm just wondering if this is the right way that I should be doing it. > Doing it way I currently am seems to result in a lot of flakeyness. > > So any help in setting me on the right course would be very > appreciated. > > Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]