Well you can do that but should not. This si kindof important.
first
global float $testx = 1.2;
is not a assignment its a initialization. It will never ever get run a second time no maya how often you call test() just once if you wish to do it every time calling test you must do:
CODE
global proc test()
{
global float $testx;
$testx = 1.2;
}
if you were to do:
CODE
global float $testx = 1.2;
global float $testx = 1.4;
then maya would just consider the value 1.2. Unless ofcourse $testx was declared elsewhere allready in wich cas eit would have that value.
Second globals do not pierce automatically into all functions. The file or scope you use must declare it. Gmasks way works but only within the same file. Its a protection mechanism so that using global $veryCommonVarName doesnet automatically penetrate into all functions as a global causing ulntold damage. Preferably you'd always call it inside your scope just to be sure you get what you want.