From: nobu@... Date: 2006-05-30T00:14:01+09:00 Subject: Re: Weird extension behavior Hi, At Wed, 24 May 2006 11:16:03 +0900, Brian Krahmer wrote in [ruby-talk:194295]: > As a debugging measure, I had the following code, which works perfectly: > puts socket.send("hello\n") > puts socket.recv_line() > > If I take the return from the send and place it in a variable, the code > takes exactly three seconds to run, as opposed to nearly instantly: > foo = socket.send("hello\n") > puts socket.recv_line() > > This causes it to hang forever: > socket.send("hello\n") > puts socket.recv_line() Some possibilities around puts. 1) it flushes stdout, and it might take effect about buffering. 2) it calls its argument's #to_s method. -- Nobu Nakada