in reply to Re: To use do or eval
in thread To use do or eval

If the code is in a database, you cannot use the eval BLOCK form, but you must use the eval EXPR form. From the Camel book (p. 705):

The first form traps run-time exceptions (errors) that would otherwise prove fatal, similar to the "try block" construct in C++ or Java. The second form compiles and executes little bits of code on the fly at run time, and also (conveniently) traps any exceptions just like the first form. But the second form runs much slower than the first form, since it must parse the string every time.

For the do function there is no such thing as a do EXPR form; only do BLOCK and do FILE (and the deprecated do SUBROUTINE), so using your data-based scripts with do seems not feasible.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re: Re: Re: To use do or eval
by perrin (Chancellor) on Jun 02, 2003 at 22:32 UTC
    Good point. I was in a hurry to point out the problems with storing code in a database and forgot that this code would be in a variable.