PadWalker can only help here if you know at least one function using var from the outer scope( see closed_over() )
Sounds very fragile.
Theoretically you could dive into B and try to localize $var from the OP tree but that's a maintenance nightmare.
If its your module just export
this doesn't confuse the ref count and is the cleanest approach.our $varref=\$var
Update: and if you love source filter hacking you could require manually, that is find the module, read the text, append the above line and eval all.
Interesting discussion, though that was most likely an XY Problem... :)
HTH
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
PS: I even doubt you can retrieve the ref of a var using B , but I'd love to know.
In reply to Re: Accessing a lexical variable of another file.
by LanX
in thread Accessing a lexical variable of another file.
by Superfox il Volpone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |