And finally, you also get IO#to_list allowing you to lazily processes huge files. For example, imagine the following code to process a 10MB file:
File.open("my_10_mb_file.txt") do |io| lines = [] io.each_line do |line| break if lines.size == 10 lines << line.chomp.downcase.reverse end end