in reply to Re: issues with eval (get a variable's value)
in thread issues with eval (get a variable's value)

Thanks for all your answers, but it seems i am missing something.
if i write
my $t; sub show { print eval "\$$_" for @_; } sub init { $t = 'test'; show(qw( t )); } => nothing
but if i write
my $t; sub show { print $t; print eval "\$$_" for @_; } sub init { $t = 'test'; show(qw( t )); } => testtest
So it seems eval can not find $t in the right scope but if i use $t in a usual way before calling eval, it can find it...