title: ruby recursive looping fails
body: <pre><code>asdf = [[1,2,3],[11,22,33,44,55,66],[51]]
  
  def recursive(params, index)
   if (index==params.size)
    puts "DONE"
   end
  
   currentParam = params[index]
   currentParam.each do |sh|
    puts sh
    recursive(params, index+1)
   end
  
  end
  
  recursive(asdf,0)
  </code></pre>
  
  <p>I was expecting an output like:</p>
  
  <p><strong>1</strong>
  11
  22
  33
  44
  55
  66
  51
  <strong>2</strong>
  11
  22
  33
  44
  55
  66
  51
  <strong>3</strong>
  11
  22
  33
  44
  55
  66</p>
  
  <p>Instead I get: </p>
  
  <p>1 11 51 </p>
  
  <p>And: </p>
  
  <p>Undefined method 'each' for nil:NilClass` </p>