The my in "inc.conf" declares $var as lexically scoped (in this case the body of the file "inc.conf"). As soon as perl is done running the code in "inc.conf", that $var goes away. It has no relation to $main::var which is what your our $var; has made available without an explicit package name. See also MJD's Coping with Scoping.
In reply to Re: global variables
by Fletch
in thread global variables
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |