In order to browse complex project sources, ones in which the configuration management system plays a very important part, it is necessary to create a lot of 'variables' to try to mimic the compiler behaviour related to file inclusion.

A large number of variables results in a jammed page header (and the more jammed in traditional link interface). Very often, all variables are not meaningful at the same time: many make sense only when some other has a certain value. It is then possible to build a dependency graph.

Starting with release 1.0, the relations within this dependency graph can be translated into the 'variables' definitions. The relation is expressed in a 'when' clause which causes the variable to be hidden if the relation is not satisfied. This contributes to clean the page header.

, 'variables' => { var_id => { 'name' => title_to_display , 'when' => conditional_expression , 'range' => [qw( … )] , 'default' => default_value } }

conditional_expression is a "logical" expression involving strings and evaluating to true or false. To be useful, it should contain references to other variables as "$var_id".

The quotation marks around the variable substitution request are mandatory. The process proceeds in two steps. First, the variable value is substituted for $var_id. Second, the resulting expression is evaluated. Without the quotation marks, the substituted value is not considered as a string but as a bare word, which is rejected as a syntax error by Perl.

Example:

, 'a' => { 'name' => 'Target architecture' , 'range' => [qw(x86 arm ppc m68k)] } , 'arm_mach' => { 'name' => 'ARM models' , 'when' => '"$a" eq "arm"' , 'range' => [qw(at91 bcmring clps711x davinci)] }

The available comparison operators are eq and ne, not == and != which operate on numbers.

'when' (conditional) variables are ordinary variables. They have no extra semantic property. They are only hidden from view when their 'when' clause evaluates to false. Even in this case, they retain their last value.

It makes no sense to turn the v version variable conditional since it is ALWAYS valid.

For sophisticated examples of conditional variables use, see the Tips pages dedicated to some software projects.