title: Why am I getting a blank array?
body: <p>I am getting a blank array when I try to print after getting continuous input.</p>
  
  <pre><code>puts "Enter the numbers you want"
  arr = Array.new()
  while gets
    arr.each do |x|
      arr =x.to_i
    end
  end
  print arr, ","
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Enter the numbers you want
  1
  2
  
  3
  ^Z
  [],
  </code></pre>
  
  <p>I would like to know if this is the right way to use <code>gets</code> and if there is a good source on handling continuous inputs in Ruby.</p>