sysread & eof



I'm use IO::Socket on linux to read from a webpage. I don't want to use
LWP::Simple. How would I find the EOF when the web server is finished
sending me the webpage? Here's what I'm using right now:

while (my $res = sysread($sock_in,$buf,$bufsize)) {
syswrite($sock_out,$buf,length($buf));
last if ($res < $bufsize);
}

It works, but obviously, if a webpage has a size that is a multiple of
$bufsize, this will loop forever.

Regards,
--
lucas
-------------------------
Perl Coder since 2001
shift || die;
-------------------------
.



Relevant Pages

  • [SLE] File permissions
    ... In a thread recently the concept of file permissions was brought up. ... I requested it as I am newish to Linux. ... Well, perhaps this webpage ... 34 Hill Street ...
    (SuSE)
  • Was: IAS Help. Is: Captive portal
    ... and be greeted with a webpage. ... Works with linux, Captive portal. ... > Any other action, like closing the browser, should terminate his/her ... > choose either the internal network or internet access. ...
    (microsoft.public.internet.radius)
  • Re: flashplayer doesnt work on 10.1
    ... Maybe flashplayer is working on other sites and I don't notice. ... There is no Shockwave player for Linux. ... Webpage Sorcery ...
    (alt.os.linux.suse)
  • PSSC: Phone Screen Sequential Capture
    ... PSSC allow to see the Symbian S60 phone's display on a window of your Linux ... PC, using bluetooth connections. ... Here is the webpage and a video showing the standard scenario: ...
    (comp.lang.python.announce)
  • Re: [Full-disclosure] Firefox 2.0.0.3 DoS crash
    ... Works for me on Linux when clicking on such link. ... Meanwhile I tried to embed it into webpage and did not work. ... tonu@duo:~/Desktop> cat poc.html ...
    (Full-Disclosure)