From: speechexpert Date: 2005-05-12T23:37:14+09:00 Subject: Re: Running a String as Ruby Code at Run-Time? simple question - Looks like Kernel#eval is the answer ;) ----- Original Message ----- From: "speechexpert" To: "ruby-talk ML" Sent: Thursday, May 12, 2005 7:02 AM Subject: Running a String as Ruby Code at Run-Time? > I want to set up a state machine, in this case I am parsing a simple > scripting language using regexp, and then running > a segment of code, which might be another regexp, etc. I'd like to be be > able to specify that code in a file... > > Can I feed a String like "str = a.scan(/\/)" #regexp here > is just an example ;) > into a method or any other way and have it execute? > > TIA > John B > > >