From: Han Holl Date: 2002-06-05T06:28:35+09:00 Subject: Dynamic local variables ? Hello, Is it possible at all to generate local variables dynamically ? What I need is roughly this: I read in a file with one or more multidimensional hashes: table = Tabel.new("/tmp/rubdefs.text") puts table["rub"]["T"]["datumontvangst"] I want to access this as: rub["T"]["datumontvangst"] If I do rub = table["rub"] I have achived this, but unfortunately I don't know the names of the first index beforehand. I've tried something like: a = %q{ rub = table["rub"]} instance_eval a but this doesn't work. (It does with @rub instead of rub, but I prefer locals). Can this be done at all? Thanks for any suggestions. Han Holl P.S. The reason I want this, that I'm busy trying to translate an old, homebrewed embedded language to ruby. This language uses the above syntax.