From: Tobias DiPasquale Date: 2001-12-18T02:30:06+09:00 Subject: [ruby-talk:28808] Re: hashes created dynamically Schlienger, Marc wrote: > [ruby-talk:28800] hashes created dynamically > Hello, > > does anyone know how to create hashes at runtime? > > Let's say I have an array of strings (size unknown a priori). Each of these > strings should be a hash key. Values for the keys will also be strings but > are not known until runtime. > > /Marco > h = {} #or, h = Hash.new ... aKey = "a" aValue = "b" h[aKey] = aValue ... -- Tobias DiPasquale Solaris System Administrator Electrical and Computer Engineering Dept. Villanova University mailto: anany@ece.vill.edu tel: 610-519-5109