From: Robert Klemme Date: 2009-05-25T00:30:07+09:00 Subject: Re: I want to redirect stderr to StringIO. On 22.05.2009 17:57, Eric Hodel wrote: > On May 21, 2009, at 21:27, Robert Klemme wrote: >> On 20.05.2009 21:01, Eric Hodel wrote: >>> They happen to be the same object though: >>> $ ruby -e 'p $stdout.object_id, $defout.object_id' >>> 97260 >>> 97260 >> Yes - until you reassign any of them. :-) > > If you reassign either of them they're still the same object: > > $ ruby -r stringio -e '$stdout=StringIO.new; $stderr.puts [$stdout, > $defout].inspect' > [#, #] Oh, I wasn't aware of this. Thank you for the education! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/