in reply to Re: trouble with packages/eval/variable-scoping (Version?)
in thread trouble with packages/eval/variable-scoping

Answering my own question, $t was still in the pad of the calling scope in my example. ¹

Otherwise the problem persists:

use v5.12; use warnings; say $]; { my $t = 42; sub foo { say eval $_[0] } } foo('$t'); -UUU:----F1 t_dyna_scope.pl All L13 (CPerl) --- -*- mode: compilation; default-directory: "~/perl/" \ -*- Compilation started at Fri Aug 30 11:25:02 perl t_dyna_scope.pl 5.036000 Variable "$t" is not available at (eval 1) line 1. Use of uninitialized value in say at t_dyna_scope.pl\ line 10. Compilation finished at Fri Aug 30 11:25:02

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Update

¹) interestingly a way to access private vars in the dynamic scope ... Quite surprising

Update

It's not dynamic scope either, probably only file scope... Needs further testing

  • Comment on Re^2: trouble with packages/eval/variable-scoping (caller's scope)
  • Download Code