in reply to Re: Re: print() on closed filehandle..
in thread print() on closed filehandle..

Not exactly. global variables just spring into existence when the compiler notices them, so our() doesn't really declare them, per se. our() serves a few different purposes. One is to get rid of the "used only once" warning (which is intended to help catch typos in variable names). If you run with use strict "vars"; turned on, you'll usually have to use our() on user variables native to a package but not qualified by a package (aka namespace). This is also intended to help catch typos in variable names.

our() also will hide a my() variable for a certain scope:

perl -we '$x = "global"; my $x = "local"; our $x; print $x' global
Here there are two different $x variables; the global $x that lives in the symbol table for the main:: package, and a lexical $x that lives in a pad (a kind of temporary storage attached to each subroutine or source file (though one pad can have multiple variables of the same name with different scopes within the subroutine)). Normally in the scope of a my($var), $var will refer to the lexical variable. our($var) can be used to override that to the end of the enclosing block.