title: How to convert STDIN contents to an array?
body: <p>I've got a file INPUT that has the following contents:</p>
  
  <pre><code>123\n
  456\n
  789
  </code></pre>
  
  <p>I want to run my script like so: script.rb &lt; INPUT and have it convert the contents of the INPUT file to an array, splitting on the new line character. So, I'd having something like myArray = [123,456,789]. Here's what I've tried to do and am not having much luck:</p>
  
  <pre><code>myArray = STDIN.to_s
  myArray.split(/\n/)
  puts field.size
  </code></pre>
  
  <p>I'm expecting this to print 3, but I'm getting 15. I'm really confused here. Any pointers?</p>