Next: , Up: Replacements



7.3.1 Global Replacement

Getstats uses a hash, %globals, to maintain a global environment. Any variable that is defined in %globals is replaced under Global replacement.

When evaluating two related expressions, Getstats declares the Perl hash %ptemp. If a variable is defined in %ptemp, it is also replaced under Global replacement. For more information See Temporary Variables.

Getstats defines several global variables automatically:

file
The name of the current relation.
fileno
The order in which this relation was specified on the command line, starting from zero. This variable is useful in conjunction with "if" to perform actions only for the first relation, or for the last relation.
filecount
How many relations were specified on the command line.

The following global variables are set or used by Getstats default library:

confidencelevel
The confidence level variable is used by statistical tests to accept or reject hypothesis, and to generate confidence intervals. The default value is 95, but this can be changed via transforms, or the command line.


delimiter
What should the table delimiter be. The default is none.
spacing
How many spaces should appear between columns in tables. The default is 1.
precision
How many decimal places are printed for floating point values. The default is 3.


wraised
This contains the count of the number of warnings raised.

The global variables colexpr, stathashes, outcols, agg_commands, and agg_threads are complex types. To modify or read them them more knowledge is required, and you should look in the corresponding manual section.