From: Brian Candler Date: 2003-04-02T19:01:04+09:00 Subject: Re: Opera bookmark cleaner. On Wed, Apr 02, 2003 at 06:54:08AM +0900, Mattia Peronio wrote: > I just had the same problem writing that program (file that remains opened). I solved the problem with a block because i don't like to inherit classes for doing simple thinks like writing a stream to a file. It's a good point about the file remaining open. You might want to note that def File.read(file_name) File.open(file_name) { |f| f.read } end is not actually doing any 'inheritance' - it's just adding a new method to an existing class. This sort of dynamic extension of classes/modules is a very common Ruby idiom. Regards, Brian.