Firstly, the syntax would be $main::VAR
Secondly, the value of variables in main are not set until after the uses at the top of the code, so you would get undef. You could address that by setting the $VAR in a BEGIN block:
... BEGIN{ our $VAR = 'fred'; } use pg; ...
But the question is why would you want to do that?
In reply to Re^3: Accessing main::Constant
by BrowserUk
in thread Accessing main::Constant
by nagalenoj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |