From: Brian Candler Date: 2011-10-19T07:13:35+09:00 Subject: Re: Return Sam Duncan wrote in post #1027273: > On 19/10/11 08:32, Phillip Gawlowski wrote: >> On Tue, Oct 18, 2011 at 8:29 PM, Darryl L. Pierce wrote: >>> The goal of puts is to output text to the console. >> To be technical: It provides output to the OS's standard output >> facility. > > $stdout = File.new('/dev/null', 'w') > puts "ohai, I am my OS's standard output facility O_o" Which actually goes to show: puts *doesn't* send output to the OS's standard output facility. Rather, it sends it to the $stdout object, which is initialised to an IO object wrapping the OS's standard output, but may be changed to point to a different IO object. -- Posted via http://www.ruby-forum.com/.