I may have found the answer here:
http://www.arl.wustl.edu/projects/fp...og/ch05_01.htm
ex.
Code:
# put some code inside $str
$str = '$c = $a + $b'; # Perl doesn't care what's inside $str
$a = 10; $b = 20;
eval $str; # Treat $str as code, and execute it.
print $c; # prints 30