This module handles Uplug configuration files. Configuration files are usually stored in the global shared folder 'system' for the Uplug libraries. Local files with relative paths and absolute paths are also accepted. Configuration files need to conform the norms of the Uplug libraries and use a perlish format (complex hashs dumped to file using Data::Dumper).

/UPLUGSHARE/ is the path to the global shared directory (if Uplug is installed properly) or the path to the local directory share in your local copy of Uplug (if you don't use the makefile to install Uplug globally). See further down for more information on environment variables and default locations in Uplug.

Uplug modules may also point to a sequence of sub-modules. Add the following structures to the config-hash within the 'module' structure:

{
'module' => {
'name' => 'module name',
##--------------------------------------------------------
## submodules are lists of Uplug config files
## (make sure that they exist and that Uplug can find them)
## - submodule names can be used to describe them
## - do not specify programs at the same time!
##--------------------------------------------------------
'submodules' => [
'config1',
'config2',
...
],
'submodule names' => [
'name of sub-module 1 (config1)',
'name of sub-module 2 (config2)',
...
],
##--------------------------------------------------------
## You can define loops over sub-sequences of sub-modules
## You can only define one loop per config file!
## The example below defines a loop over
## sub-module 1 and 2 which will be run 3 times
## (start counting with 1)
##--------------------------------------------------------
'loop' => '1:2',
'iterations' => '4'
}
}

Look at the pre-defined configuration files to see more examples of possible configuration structures.

$SHARED_HOME is the global directory of shared files for Uplug (if properly installed) or the directory set in the environment variable UPLUGSHARE.

If you start a local copy of uplug (not the globally installed one): Uplug tries to find local directories of shared files ('share') relative to the location of the startup script (/path/to/script/share or /path/to/script/../share) or relative to the environment variable UPLUGHOME (if set). Note that the environment variable UPLUGSHARE overwrites these settings again.

Tries to find the executable program on your local system. It first looks in your global path. Thereafter, it checks the shared home of binaries bundled in this package. It uses $OS_TYPE and $MACHINE_TYPE to identify the appropriate binary.

Reads configuration for a given module, merges this with the (default) configuration hash in $config and sets additional parameters given in $param. The global configuration of $module overwrites the default configuration of $config and parameters in param overwrite this merged configuration.

$param can be a reference to an array (actually containing key-value pairs) or a string of space-separated key-value pairs. These are usually the command-line arguments given when starting a specific module using the Uplug startup scripts. This means that command-line short-cuts as specified in the configuration file will be expanded to set the appropriate key in the deep data structure of the config-hash. (see also CheckParam)

Read the configuration of a given module, expand 'named data streams' (the ones defined in DataStreams.ini and UserDataStreams.ini) and Uplug variables (see below) and set parameters specified in @{params}.