Hi,
I have a small socket program that basically opens a socket executes a command and gets results. The problem I have is my program just prints the first line of the results. I would like to see all lines in the result.
Here is my program:
---------------------------------------------
#!/usr/perl/bin -wc
use IO::Socket
$remote_host = "test.site.com";
$remote_port = 6666;
$socket = IO::Socket::INET->(PeerAddr =>$remote_host,
PeerPort =>$remote_port,
Proto =>"tcp",
Type => SOCK_STREAM)
or die 'couldn't connect to $remote_host:$remote_port : $@\n";
print $socket "getresults\n";
$answer = <$socket>;
print "$answer";
close($socket);
---------------------------------
The $answer prints only one line while I want it to print all the lines.
Would help if an expert could answer this,
balji
I have a small socket program that basically opens a socket executes a command and gets results. The problem I have is my program just prints the first line of the results. I would like to see all lines in the result.
Here is my program:
---------------------------------------------
#!/usr/perl/bin -wc
use IO::Socket
$remote_host = "test.site.com";
$remote_port = 6666;
$socket = IO::Socket::INET->(PeerAddr =>$remote_host,
PeerPort =>$remote_port,
Proto =>"tcp",
Type => SOCK_STREAM)
or die 'couldn't connect to $remote_host:$remote_port : $@\n";
print $socket "getresults\n";
$answer = <$socket>;
print "$answer";
close($socket);
---------------------------------
The $answer prints only one line while I want it to print all the lines.
Would help if an expert could answer this,
balji