From: Pit Capitain Date: 2008-03-07T16:37:17+09:00 Subject: Re: Meta Programming Question 2008/3/5, MohsinHijazee : > If I have a hash like this which contains code snippets as strings, > How can I execute them? Moreover consider also that the second code > snippet uses the value of the variable assigned in the first one. Mohsin, as others have mentioned you should probably use other libraries, but just in case you want to continue to eval strings, there's no problem with assigning variables and using them later: irb(main):001:0> eval "var = 123" => 123 irb(main):002:0> eval "2 * var" => 246 irb(main):003:0> Regards, Pit