Hi,

I am sorry to inform you so late.

Actually, my subroutine "returned" before printing. Else everything was correct.

Thanks for your help.

Regards
Rajeev

-----Original Message-----
From: Kipp, James [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 12:33 AM
To: Pandey Rajeev-A19514; [EMAIL PROTECTED]
Subject: RE: Help !!! on sockets


 
> When I print the @buffer outside the while loop , I am not 
> getting the output.
> 
> Note : The commented line i.e. #print "Server: $_"; works and 
> prints all the lines read from the socket.
> 
> Please somebody tell me what error have I been making.
> 
> Regards
> Rajeev
> ****************************************************
> sub send_msg {
>     $sock = shift @_;
>     $msg = shift @_;
> 
>     my @buffer;
> 
>     select($sock);
>     $| = 1;
>     select(STDOUT);
> 
>     print $sock $msg, "\n";
>     while (<$sock>) {
>     if( $_ =~ /^DONE$/) {
>         print "Server: $_";
>         return;
>     }
>     #print "Server: $_";
>     push @buffer, $_;
>     }
>     print @buffer;
> }
 
try: $buffer .= $_; 
print $buffer;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to