title: How "puts" statement works in Ruby?
body: <h1>I knew that puts return always <code>nil</code> by itself.</h1>
  
  <p>But knowing that fact already I have started to play around it. here it is:</p>
  
  <pre><code>&gt;&gt; puts
  
  =&gt; nil # Good, you are doing what I expected.
  
  &gt;&gt; puts 15
  15
  =&gt; nil # nil is for puts and 15 it printed,as it is assigned to do. perfect still.
  
  &gt;&gt; puts a = 5 + 2
  7
  =&gt; nil # still good.
  </code></pre>
  
  <p>Now I will do a bit more with <code>puts</code> to see how robust it is.</p>
  
  <pre><code>&gt;&gt; puts a= 5 + 2;b= 2+3
  7
  =&gt; 5 #ahh! where is nil?
  
  &gt;&gt; puts a= 5 + 2;b= 2+3;c= 4+8
  7
  =&gt; 12 # again no nil. Another confusion created here that why 12 and 7 only, how 5 has been skipped?
  </code></pre>
  
  <p><em><strong>How <code>puts</code> <code>nil</code> value has been suppressed ?</em></strong></p>
  
  <p>Okay, so lets test another way where <code>nil</code> has been gone.</p>
  
  <pre><code>&gt;&gt; x=puts a= 5 + 2;b= 2+3;c= 4+8
  7
  =&gt; 12
  
  &gt;&gt; puts x
  
  =&gt; nil # humm, nil is there. but why not nil =&gt; nil? Confusion here again goes up. whose nil is it?
  </code></pre>
  
  <p>Can anyone help me by saying the actual behaviour of <code>puts</code> in Ruby's world?</p>