[Tutor] GoFish

Erik Price erikprice@mac.com
Sun, 12 May 2002 16:20:42 -0400


On Saturday, May 11, 2002, at 12:08  PM, Russell Bungay wrote:

> Is there a nicer way than using eval?  I don't like it much, not sure
> why, it just seems wrong.

Keep in mind that eval() exists for a reason -- it is a useful 
function.  The problem is only if it is used sloppily, such as 
evaluating user input.  If you are certain that your code does not 
enable user input to work its way into the contents of an eval() 
argument, then you should be fine.

I've heard it said that one never HAS to use eval(), that there is 
always another way.  Perhaps.  But there are times when it is an 
extremely useful way to generate dynamic variable names.


Erik