title: Ruby Program not reading all lines in files
body: <p>I am new to ruby and have the following code that reads in a file, then places the symbols separated by a '|' sign into different attributes of a Struc data type:</p>
  
  <pre><code>Song = Struct.new(:title, :name, :length)
  song_file = File.new("songdata.txt")
  songs = []
  
  song_file.each_line do |line|
      file, length, name, title = line.chomp.split(/\s*\|\s*/)
      songs &lt;&lt; Song.new(title, name, length)
  end
  
  p songs
  </code></pre>
  
  <p>The file songdata.txt contains the following txt:</p>
  
  <pre><code>/jazz/j00132.mp3  | 3:45 | Fats     Waller     | Ain't Misbehavin'
  /jazz/j00319.mp3  | 2:58 | Louis    Armstrong  | Wonderful World
  /bgrass/bg0732.mp3| 4:09 | Strength in Numbers | Texas Red
  </code></pre>
  
  <p>However, when I go to print the array songs, it only contains the first line of the text file. Any thoughts on to why this is?</p>