From: Matthew Margolis Date: 2004-09-07T05:39:55+09:00 Subject: Re: include? only true once David A. Black wrote: >Hi -- > >On Tue, 7 Sep 2004, Matthew Margolis wrote: > > > >>blockFile = File.new("blocklist.txt", "a+") >>print blockFile.read.include?("aa") >>print blockFile.read.include?("aa") >> >>blocklist.txt looks like >>-------------------------------------------- >>aa >>ae >>aj >>au >>ae >>--------------------------------------------- >> >> >>Why does #include? return true on the first call only? >> >> > >Because you've reached end-of-file :-) > > >David > > > blockFile = File.new("blocklist.txt", "a+") print blockFile.read.include?("aa") blockFile.lineno = 0 print blockFile.read.include?("aa") Still gives true false instead of true true -Matthew Margolis