Runtime evaluation: Difference between revisions

m (Fixed lang tags.)
Line 237:
 
=={{header|Perl}}==
 
{{incorrect|Perl|It does not discuss passing in or returning values, or the environment the expression is evaluated in.}}
Any expression can be passed to <code>eval</code>, in run-time the expression is parsed and executed in the same scope as it was called so any variables declared are visible in the <code>eval</code> and variables declared inside the eval still exist afterwards, you can use the <code>return</code> statement to exit the <code>eval</code> returning a value, if omitted, the result of the last expression evaluated will be returned.
 
<lang perl>($a, $b) = (5, 7);
Anonymous user