in reply to Re: issues with eval (get a variable's value)
in thread issues with eval (get a variable's value)
but if i writemy $t; sub show { print eval "\$$_" for @_; } sub init { $t = 'test'; show(qw( t )); } => nothing
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...my $t; sub show { print $t; print eval "\$$_" for @_; } sub init { $t = 'test'; show(qw( t )); } => testtest
|
|---|