Read the documentation for our:
our associates a simple name with a package variable in the current package for use within the current scope. When use strict 'vars' is in effect, our lets you use declared global variables without qualifying them with package names, within the lexical scope of the our declaration. In this way our differs from use vars , which is package scoped.
That means, despite the fact that our creates a package global, it is created for use within the current lexical scope. But it's still a package global. Strictures balks at the use of $c outside of the BEGIN{} block. But that too is only if strictures is effect in the lexical scope in which it is being violated. Since your first example breaks strictures, but does so outside of the scope in which strict is in effect, you get no complaint. The second example breaks strictures, and does so within the same scope in which strictures is effect, so you get a complaint.
Dave
In reply to Re: BEGIN blocks and use strict positioning
by davido
in thread BEGIN blocks and use strict positioning
by codeacrobat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |