That's not just "another way" -- it's a much better way, for most
purposes. If you can avoid using eval without complicating your code
overmuch, you should, for purposes of not completely screwing up
something by (for instance) plugging user input directly into an eval and
ending up with horribleness being executed.
···
On Tue, Dec 04, 2012 at 09:00:56PM +0900, Jesús Gabriel y Galán wrote:
But there's another way. Instead of constructing a variable, you could
create a hash whose keys are the "variables":