Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Problem with IO::Select

by merlyn (Sage)
on Mar 01, 2007 at 00:02 UTC ( #602624=note: print w/replies, xml ) Need Help??

in reply to Problem with IO::Select

my $rx_txt; while (length($rx_txt)) { $sock->recv($rx_txt, 1024); $buff.=$rx_txt; }
Last time I checked, the length of undef is 0 (while getting a warning), and that's false. Can't imagine the code inside that loop makes much difference then. :)

Replies are listed 'Best First'.
Re^2: Problem with IO::Select
by timos (Beadle) on Mar 01, 2007 at 00:11 UTC
    You are right of course. But this does not fix my problem. The results are the same with
    while (length($rx_txt) > 0) { $sock->recv($rx_txt, 1024); $buff.=$rx_txt; }
    But I have to admit I am a little bit ashamed of myself now. :-)
      You still aren't reading anything. length(undef) is certainly not greater than 0.

      Also, $sock is not the right socket to be reading from anyway.

        Ah, ok. So I changed it to
        my $rx_txt = "something"; while (length($rx_txt) > 0) { $conn->recv($rx_txt, 1024); $buff.=$rx_txt; }
        But the problem stays the same.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602624]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2019-07-20 07:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found