I'm creating socket like this
$sock = IO::Socket::INET->new (
Proto => "tcp",
PeerAddr => "127.0.0.1",
PeerPort => 80,
Reuse => 1
);
After that sending some HTTP requests
print $sock $dane;
i chce odczytać odpowiedź
while(<$sock>)
{
print $_;
}
Next I'm trying to send another requests with the same connection, but script prints all lines of response and hangs, i think it's waiting for more lines. Is it possible to print only the response which has been transfered to our computer and not waiting anymore?
I tried to recognize new line character, but neithe \n neither \r\n works. I need it to get the response without HTTP headers