in reply to Re^2: Tricky scope problem
in thread Tricky scope problem

I tend to think of using "our $var;" as the equivalent of an external command in C/C++, a way to link a file global var across mulitple files.

This is correct; but in all files this variable should be declared with our. But there's more to variables declared with 'our':

Example:

package Foo; our $foo = 'foo'; # $Foo::foo now exists package main; print $foo,"\n"; # $Foo::foo, not $main::foo ! print $Foo::foo,"\n"; __END__ foo foo