
buildconfig - Convert a subsectional configuration to hash strings

usage: buildconfig.pl [options] file

-t string string identifier -h output usage -V version info

To gain knowledge on how the configuration principle works, you might have a look at the supplied user configuration. It is vital to understand, that the level (declared by $level) and the identifier (declared by $identifier) are essential factors on the creation of keys within a hash string.
Lines beginning with a leading # and no following $ are not essential for the parsing process, but keep the visual and cognitive structure upright.
Lines beginning with a leading # and a following $ are vital to the process of data parsing.
Lines beginning with alphanumeric characters equal key/value entries.
# =============================
# SECTION: directories
# =============================
# INDEX: D.1
# =============================
#
# Description:
# °°°°°°°°°°°°
# Includes paths concerning
# your directories.
#
########
#$level=1
#$identifier=dir
#############
#--------------------
# Path: log directory
#--------------------
log = /var/log
An overall appearance of a section entry and assigned key/value entry.
# =============================
# SECTION: directories
# =============================
# INDEX: D.1
# =============================
Classifies the section level (SECTION, SUBSECTION, SUBSUBSECTION), the identifier of the section, its index level which consists of the first capitalized character of the section identifer and an integer from 1 - 3.
[ 1 = SECTION,
2 = SUBSECTION,
3 = SUBSUBSECTION ]
# Description:
# °°°°°°°°°°°°
# Includes paths concerning
# your directories.
A short section description.
#$level=1
#$identifier=dir
The flags which are of interest to the build script. $level sets the section level, $identifier sets an alphanumeric identifier.
#--------------------
# Path: log directory
#--------------------
log = /var/log
The value on the left side functions as key, while the the value on the right functions as value.
An example hash string will look as following:
$Data{config}{dir}{log} = '/var/log';
The parsing process follows a sequentiell logic.
The structure tree
| + Level - 1
| ++ Level - 2
--------------
| + Level - 1
| ++ Level - 2
| +++ Level - 3
--------------
| + Level - 1
is valid, while
| + Level - 1
| +++ Level - 3
proves to be invalid.
Ascending in level deepness allows skipping of levels, whereas descending in level deepness requires that accordingly no level is skipped.
A "level 1" hash string:
$Data{config}{dir}{log} = '/var/log';
A "level 2" hash string:
$Data{config}{file}{system}{log} = '/etc/syslog.conf';
A "level 3" hash string:
$Data{config}{file}{system}{user}{entries} = '/etc/master.passwd';
The last two values, in this case 'entries' & '/etc/master.passwd' correspond to the key & value pair, while the leading parts are determined by an internal CONSTANT ( $Data{config} ) and three subsequent level identifiers.
internal CONSTANT: $Data{config}
Level 1 - identifier: file
Level 2 - identifier: system
Level 3 - identifier: user
Key: entries
Value: /etc/master.passwd