From: Sebastian Hungerecker Date: 2007-12-19T05:59:47+09:00 Subject: Re: New to ruby bigbrother wrote: >> Drew Olson wrote: >>> File.open("my_log.txt") do |line| >>> user = line.scan(/US=(\w+)/).flatten.first >>> user_requests[user] += 1 >>> end > > Cool, thanks. When I'm trying it though I get > Joshua$./test.rb > ./test.rb:4: private method `scan' called for # (...) > What does that mean? It means that you're calling scan on line when line is File object which doesn't have scan. If you change File.open to File.foreach, line will actually be a line of the file (i.e. a string) and the code will work. HTH, Sebastian -- NP: Sentenced - With Bitterness And Joy Jabber: sepp2k@jabber.org ICQ: 205544826