From: Karl von Laudermann Date: 2008-01-16T00:00:06+09:00 Subject: Re: Attempted solution. :) On Jan 15, 8:58 am, James Gray wrote: > > If we move that code into a method: > > def force_puts(*args) > puts(*args) > $stdout.flush > end > > we can use that from now on. > > In this case though, Ruby has a variable to force flushing the > output. If you set it at the top of your script, you can omit all of > the calls to flush(): > > $| = true I personally tend to avoid using those cryptic Perl-like two character globals. I would write the above as: $stdout.sync = true Incidentally, I can't find any reference to $| in the Pickake, second edition, so I wouldn't have even known about it if you hadn't posted this. It doesn't seem to be listed anywhere on pages 334-337, nor in the index.