From: Vahagn Hayrapetyan Date: 2011-04-13T20:28:08+09:00 Subject: Re: Calling to_enum on a MatchData object >> You are doing lots of unnecessary work there. Since MatchData#captures >> returns an array and Array already defines each, you don't need to >> create >> any enumerator at all to iterate through the #captures array: >> > > As the op said: > >>>> This is what I've done just to >>>> experiment: Exactly - that was just to get proof of Enumerator working. In my method, I just use :each of an Array object: def x File.open('screen.css') do |f| while line = f.gets file = line.match(/" (\w* [.] css) "/xms).captures file.each do |entry| puts entry y(entry) end end end end -- Posted via http://www.ruby-forum.com/.