From: Peter Bailey Date: 2008-01-04T04:56:01+09:00 Subject: Re: Why doesn't this file read work for me? > If you only want to check whether stuff contains that substring, I think > you > should use String#match, not String#scan. String#match returns an object > of > class MatchData if there's a match and nil otherwise, which allows you > to use > the conditional like you did your code (check the ri documentation for > String#scan and String#match for more details). > > By the way, why do you call to_s on the result of File.open ? Isn't it > already > a string? > > I hope this helps > > Stefano Yup. This helps a lot. I used .match and it worked beautifully. Regarding the .to_s thing, that's just me being neurotic and thinking I needed it. No, I don't need it. -- Posted via http://www.ruby-forum.com/.