Anonymous user
Runtime evaluation: Difference between revisions
→{{header|Perl}}
m (Fixed lang tags.) |
|||
Line 237:
=={{header|Perl}}==
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);
|