in reply to How to declare and use global variables

From the docs:

An "our" declaration declares a global variable that will be visible across its entire lexical scope, even across package boundaries.

Note that separate files each do have their own lexical scope...

Personally - in the few cases that I want to use global variables - I refer to them fully qualified ($Inst::make_AR_1 in this case). The additional typing required every time make me rethink whether I really want to have the variable global :)

Replies are listed 'Best First'.
Re^2: How to declare and use global variables
by JavaFan (Canon) on Nov 03, 2008 at 15:00 UTC
    Are you consistent? That is, you always write $main::_ and @main::ARGV instead of $_ and @ARGV?

      No...  Inconsistency is a personality trait of mine which sometimes comes in handy :)