1mNAME0m
       global - Access global variables

1mSYNOPSIS0m
       1mglobal 4m22mvarname24m ?4mvarname24m 4m...24m?


1mDESCRIPTION0m
       This  command  has  no  effect unless executed in the context of a proc
       body.  If the 1mglobal 22mcommand is executed in the context of a proc body,
       it creates local variables linked to the corresponding global variables
       (and therefore these variables are listed by info locals).

       If 4mvarname24m contains namespace qualifiers, the local variable's name  is
       the  unqualified  name  of  the  global  variable, as determined by the
       1mnamespace tail 22mcommand.

1mEXAMPLES0m
       This procedure sets the namespace variable 4m::a::x0m
              proc reset {} {
                  1mglobal 22ma::x
                  set x 0
              }

       This procedure accumulates the strings passed to it in a global buffer,
       separated  by  newlines.   It is useful for situations when you want to
       build a message piece-by-piece (as if with 1mputs22m)  but  send  that  full
       message in a single piece (e.g. over a connection opened with 1msocket 22mor
       as part of a counted HTTP response).
              proc accum {string} {
                  1mglobal 22maccumulator
                  append accumulator $string \n
              }


1mSEE ALSO0m
       namespace(n), upvar(n), variable(n)


1mKEYWORDS0m
