From: 7stud -- Date: 2011-09-10T04:28:00+09:00 Subject: Re: null pointer given - hash Angelo Farias wrote in post #1021017: > each and fetch hash doesn’t work They work fine: hash = {'a' => 10, 'b' => 20} hash.each do |key, val| puts "#{key} = #{val}" end --output:-- a = 10 b = 20 puts hash.fetch('c', "sorry") --output:-- sorry -- Posted via http://www.ruby-forum.com/.