[geeks] One of these days....

R. Lonstein rlonstein at pobox.com
Mon Apr 15 20:33:40 CDT 2002


On Mon, Apr 15, 2002 at 06:54:44PM -0400, James Sharp wrote:
    [snip]
> while (<$sock>) {
    [snip]
> So somewhere between the first and second iterations, it suddenly decides
> that math is hard and it wants to go shopping.
    [snip]

I suspect that whatever process you have running on port 8888 is only
returning a single response and while() isn't catching that.

Try this:
    while( defined($_=<$sock>) ) {

Which should work and should detect an empty response. You might also
make sure that no buffering is going on by setting $|=1 (autoflush).

- Ross



More information about the geeks mailing list