Puts is a method of Kernel.

Andreas S wrote:
> Can anybody help me understanding the relation between Kernel#puts, 
> STDOUT and $stdout?
> 
> I thought 'puts' is equivalent to '$stdout.puts'. Why 'puts' doesn't 
> give same result as 'STDOUT.puts'?
> 
> class << STDOUT
>  def puts(*args)
>     args[0] = "I say " + args[0] unless args.empty?
>     super(args)
>  end
> end
> 
> puts "hello"
> STDOUT.puts "hello"
> $stdout.puts "hello"
> => hello
>     I say hello
>     I say hello
> 
> 
> Thank you in advance
> -andre
> 
> _________________________________________________________________
> Talk now to your Hotmail contacts with Windows Live Messenger. 
> http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview 
> 
> 
> 
>