>>410
$result = eval($hoge);

じゃダメなん?($resultに実行結果、$@にエラーメッセージ)

参考
ttp://www.tohoho-web.com/wwwperl2.htm#eval