From: botp Date: 2009-08-17T11:31:52+09:00 Subject: Re: while !file.eof? On Mon, Aug 17, 2009 at 10:03 AM, Derek Smith wrote: > How can I use a while loop in such as way where I want to process the > file until EOF? on your case, you do not need the EOF sig. Pls read on ruby's iterators and File. >.... > File.open(mailog, 'r+').each { |line| >        while !mailog.eof? >            if line =~ /^#{last_record}/o >                p line >            end >        end > } try eg, File.open( "maillog" ).each do |line| p line if line =~ /^#{last_record}/ end kind regards -botp