http://qs321.pair.com?node_id=24110


in reply to i thought i knew 'our'...

'our' does _not_ declare a lexical scoped variable! What 'our' does is to say that the variables _name_ shall be lexical scoped. so:
use strict; { our $y = 17; print "inner: $y\n"; } print "outer: $y\n";
says that you are allowed to use the name '$y' in the block. Its name is lexical scoped. It does enter the name $y into the stash. Now, as you have discovered, without strict you may access $y's value. So, how to do it with strict on ?
use strict; { our $y = 17; print "inner: $y\n"; } print "outer: $main::y\n";
strict don't let you use globals (variables that live in the symbol table) unless:
  1. being told that it's actually ok (using 'our' or 'use vars')
  2. you fully qualify its name, as in $main::foo
So naturally, without strict you may access variables without fully quallifying them as in your last example.

Autark.