You can't just eval() like you did. First, you can't use the BLOCK form of eval. Secondly, you'll need multiple levels of evaluation. You could use my DynScalar module on CPAN if you'd like to do this seamlessly.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart