At 09:39 +0100 2001.03.06, Bart Lateur wrote:
>On Mon, 05 Mar 2001 21:54:26 +0100, Giorgio Valoti wrote:
>
>>As a real newbie I have to ask why should I avoid the eval... Also, in
>>which situation you would recommend its use, other than trapping otherwise
>>fatal errors?
>
>Because the "code" really is a string, and it needs to be recompiled
>every single time you call it. That will be a lot slower.

And also, depending on your situation, can open you up to insecurities more
easily.  There's just more to be aware of when you are using eval() in a
situation with a script you will be giving others access to (such as a CGI).

But yeah, there is a difference between eval() and eval {}.  I use the
latter for trapping errors fairly often.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to