From: Robert Klemme Date: 2008-01-01T00:05:00+09:00 Subject: Re: using reg expr with array.index On 31.12.2007 08:14, MonkeeSage wrote: > Ps. ruby will normally close open file handles on garbage collection > or in finalization, but just in case of some catastrophic failure > (what, I'm not sure), it's usually considered good practice to close > file handles manually: > > ... > file=File.open(ARGV[0]) > data=file.readlines > file.close > ... ... in which case I'd rather use the block form because then the FH is closed under all circumstances. File.open ARGV[0] do |file| data = file.readlines end Although in this case you can simply do date = File.readlines ARGV[0] :-) Kind regards robert