From: touch freedom Date: 2001-05-11T19:42:04+09:00 Subject: [ruby-talk:14988] Re: Array -> Hash convertion? the %w() thingy in ruby does the same as the qw() thingy in perl, and you can populate your new hash if you declare it like so: a_hash = Hash.[](*%w(key value etc. &c.)) kinda weird, kinda hacked, but it'll work like you want it to, and i couldn't get anything else to. there might still be a better way to do it out there (?) ^_^ Martin Chase -----Original Message----- >Sorry to raise another newbie question, > >Coming from a perl world, I like to write something like > > %hash = qw( foo led bar tender ) > >and have a hash initialized to > > {foo => led, bar => tender} > >Is anything like this possible in Ruby? > >Renald "If you think you are too small to make a difference, try sleeping in a closed room with a mosquito..." African Proverb ___________________________________________________ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com