in reply to Accessibility of package-level variables

Unfortunately, "use strict" did not help you in this case.

You have a simple typo - correcting that makes it work as you expect.

In main, you call it "package_variable" (injecting this new, undeclared variable into Bar's namespace), whereas in Bar, you reference apparently the same intended variable, as "$package_var".

The different addresses for the different variables were a clue.

ikegami can probably un-strikeout (or is it un-redact?) his comment, which had the right idea.

     "How many times do I have to tell you again and again .. not to be repetitive?"

  • Comment on Re: Accessibility of package-level variables