Eily: All I can say is that with B::Deparse the package prefix seems to be removed,
No, that is turned around reasoning. I would say: The package prefix is not added.
The problem that is described here is not in the BEGIN block but the last $x++ statement which should be explicitly mentioned: $main::x++; because $x is not exported imported. The Parser translates to '$main::x' automatically because the package statement resides in the BEGIN block. When it is outside the BEGIN block, it doesn't do that. In none of the cases, the variable $x is exported imported.
edit: As far as documentation concerned I believe it can be found under: package, paragraph 2, the promise that a package statement does not affect lexically-scoped variables
In reply to Re: Logic for importing and strict vars?
by Veltro
in thread Logic for importing and strict vars?
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |