On 05.02.2010 00:10, Albert Schlef wrote:
> Robert Klemme wrote:
>>     File.foreach(file).each_slice 2 do |name, pwd|
>
> How is it better than 'File.open(file).each_slice' ?

It closes the file handle properly which your variant doesn't do.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/