From: Han Holl Date: 2002-06-06T06:08:45+09:00 Subject: Re: Dynamic local variables ? Park Heesob wrote: >"Han Holl" wrote in message >news:3CFD3100.3010404@pobox.com... > > >>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"] >> >> >> > >Hi, > > >I think PHP's extract and compact function is useful. > >extract -- Import variables into the current symbol table from an array >compact -- Create array containing variables and their values > >I implemented with ruby using global variable. > > > Yes, my problem was with _local_ variables. But thanks to Guy Decoux's excellent explanation (in the related thread you started), I've found a solution involving method_missing. Thanks for your reaction, Han Holl