libconfig-general-perl/example.cfg

74 lines
1.5 KiB
Bash

# -*-sh-*- (ignore, this is just for my operation system, emacs,
# to function properly)
#
# This is an example of a config file supported by Config::General.
# It shows almost all features of the format and its flexibility.
#
# To try it, install Config::General as usual and execute the
# following perlscript:
#
# use Config::General;
# use Data::Dumper;
# my %conf = ParseConfig(-ConfigFile => "example.cfg", -InterPolateVars => 1);
# print Dumper(\%C);'
#
# This will parse the config and print out a stringified version
# of the hash it produces, which can be used in your program.
#
/*
* c-style comment
*/
# variable assignment
option1 = blah
option2 blubber
option3 = "something special" # this is a comment
option4 = parameters can be written on \
multiple lines
# duplicate options will be made into an array
huc = 12
huc = 17
huc = 133
# options can be organized in blocks too
<sql>
user = hans
server = mc200
db = maxis
passwd = D3rf8d
# nested blocks are no problem
<tablestructure>
index int(100000)
name char(100)
prename char(100)
status int(10)
</tablestructure>
</sql>
# named blocks can also be used
<area santa-barbara>
# block names containing whitespaces must be quoted
<"kyla cole">
# blocks maybe empty
</"kyla cole">
</area>
# here-docs are fully supported
usage <<EOF
use with care
and don't ask me
EOF
# use of variable interpolation
var1 = hoho
msg = $var1
# that's it for today.