Script functions reference > Script functions in alphabetical order > E > Eval

Eval
Syntax
Eval(str);
str
Description
Evaluates all global variables in the argument string.
Returns
str
A string in which all global variables have been replaced by their values. If evaluation fails an empty string is returned.
Example
$question = "life, the universe, and everything";
$answer = "42";
$result = Eval ("The answer to the question of $question is $answer");
$result will then contain
"The answer to the question of life, the universe, and everything is 42"
Example
In this example, the hexadecimal value <22> is used to insert double quotation marks in a Perl call.
$command = eval("perl -e <22>sleep 60 <22>");
execute( $command, 61 ); // sleep for 60 secs 
OpenText StreamServe 5.6.2 Updated: 2018-01-26