From: csn Date: 2006-02-05T04:10:22+09:00 Subject: Re: Extract hash into local variables? Thanks for the replies. I also found this bit of code: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/41812 Which is similar to Scott's 'instance_variable_set' above: def extract(hash) hash.each do |key,value| eval "$#{key} = #{value.inspect}" end end Maybe it's possible to rewrite this into something inside of a function which only sets local variables: def foo(args=>{:a=>1, :b=>2, :c=>3}) for key, value in args # or for args[0..args.length] ? eval "#{key} = #{value.inspect}" end puts a, b, c end I'm surprised there's not an easy and simple way too ;(. I read in Programming Ruby that named arguments are planned for Ruby 2.0. csn -- Posted via http://www.ruby-forum.com/.