From: "Simon Kröger" Date: 2005-12-10T05:00:13+09:00 Subject: Re: new to Ruby - pls help in translating this > I'll go with: > > seen = {} > > ARGF.each do |elem| > print elem if seen.include? elem > seen[elem] = true > end Thanks, this is how ruby should look like! here is another one (i like it a bit more functional style): quantities = Hash.new{|h, k| h[k]=0} ARGF.each{|l| quantities[l.chomp.to_i] += 1} puts quantities.delete_if{|k, v| v <= 1}.keys cheers Simon