in reply to Interpreting variables pulled from MySQL

Is it possible for you to use 'eval' ?

$sql_res = 'I wish I were a $type_of_animal'; $sql_res =~ s/(\$\w+)/eval$1/ge;