Hi there,
I would like to perform a special check on scripts
before they are evaluated. We have this situation:
* we provide a set of functions
* our users should use just these functions, nothing
else
Therefore, a typical script would look like this:
use Ourlib;
ourSub("arg1", 2, "arg");
ourSub1();
ourSub2(3);
ourSubX("CONST1", "CONST2");
The execution of this functions might take
a lot of time. Therefore we would like to
ensure that all method calls are "correct" -
before we start to execute the first call.
E. g. we know that ourSubX will accept only
2 strings from a set of 5 possible values or so.
Therefore if someone mistakely writes
ourSubX("CONSTL", "CONST2") we would like to
stop right in the beginning.
Of course we cant check for any kind of mistake -
but we would like to avoid the situation where a script
fails after 20 hours because someone
wrote "CONSTL" instead of "CONST1" in the last line of
a script ...
I think the easiest solution for this requirement
is to use the perl compiler package and to check
any call to a method in the script - before the script
itself is executed.
Well, knowing what to do is not quite the
same as knowing how to do it ...
maybe someone can tell me where I can find
some SIMPLY examples/tutorials of how to use the B package -
for example it would be really nice to see code that
reads a perl script and then walks over the corresponding AST
and prints out all the nodes of the AST.
thx,
edwin günthner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]