title: Reading from stdin and printing to stdout in Ruby
body: <p>This question is kinda simple (don't be so harsh with me), but I can't get a code-beautiful solution. I have the following code: </p>
  
  <pre><code>ARGF.each_line do |line|
    arguments = line.split(',')
      arguments.each do |task|
      puts "#{task} result"
    end
  end
  </code></pre>
  
  <p>It simply read from the standard input numbers. I use it this way: </p>
  
  <pre><code>echo "1,2,3" | ruby prog.rb
  </code></pre>
  
  <p>The output desired is</p>
  
  <pre><code>1 result
  2 result
  3 result
  </code></pre>
  
  <p>But the actual output is</p>
  
  <pre><code>1 result
  2 result
  3
   result
  </code></pre>
  
  <p>It seems like there's a newline character introduced. I'm skipping something?</p>