Next: , Previous: Default Function Library, Up: Getstats Internals

7.3 Replacements

Throughout Getstats its behavior is controlled by replacing internal variables with the actual values that are taken from the current relation and an environment. Depending on the current context, there are four types of replacement: Global, Row, Column, and Value.

Within a string that undergoes replacement, variables are denoted by $var, where var is the name of a variable. For example, in the string 1 + $val, if val is defined as 2, the string becomes 1 + 2. If val is not defined, no replacement occurs.

Because these replacements are often passed to Perl's eval function, invalid variables are be caught by Perl. If the string is not evaluated by Perl, then it is output, and the user sees that no substitution took place.