From: Kyle Schmitt Date: 2009-08-18T01:22:44+09:00 Subject: Re: while !file.eof? It's not always appropriate, but File.read() is pretty slick too... I'm pretty sure it's just syntactic sugar, but it makes things quite clear. data=File.read("somefile") If you want to just get content specific lines for instance, you'd use scan on top of that. may_lines=File.read("/var/log/messages").scan(/May .+/)