in reply to Examples fo Where "our" is really needed

See also 'our' is not 'my' (it's linked from the tutorials, under variables). In short, the only advantage is if you've got a lexical variable and a global variable with the same name. my declares a variable and its scope. our declares the scope in which a name refers to a global variable. A subsequent my would override a previous our, and a subsequent our would override a previous my.

Of course, if you override a my at the same level, you've effectively pushed it out of scope. You can't reach that variable anymore. I don't know whether Perl itself considers it an end of scope, though.

If, instead of replacing it with our, use vars had been upgraded to a real, scoping pragma, then there could have been a no vars to declare the end of global scope, and you'd get your lexical back.


Caution: Contents may have been coded under pressure.