From: Daniel Schierbeck Date: 2006-07-09T02:20:15+09:00 Subject: Sweet Lord! Why haven't I thought of this before? class Terminal include Enumerable def each(&block) while input = gets block.call(input.chomp) end end end terminal = Terminal.new # terminate the loop with ctrl-d, or whatever works for you. terminal.entries terminal.map{|line| line.to_sym} terminal.inject(""){|str, line| str << line} Yet another epiphany. Thank you, Ruby. Cheers, Daniel