Skip to content
Newer
Older
100644 46 lines (31 sloc) 1.68 KB
454da90 @supernovus Perlite::Data becomes HashConfig::Magic, added HashConfig::File.
authored
1 HashConfig
2 -----------
3
4 A couple of libraries for representing configuration data as a Hash.
5
6 The libraries are designed using a common Role, and support multiple
7 parsers for data types. The default parser is HashConfig::Parser::JSON
8 which uses the JSON::Tiny library.
9
10 HashConfig::Magic
11
12 Basically, a HashConfig::Magic object works just like a normal Hash,
13 except that it has methods such as loadFile() and load() which will parse
14 a serialized data format and merge the contents into the Hash.
15
16 It defines special key names and values for dealing with merging data.
17
18 If a key name starts with +, then the value will be appending to an array
19 (which will be created automatically if the current value is not an array.)
20 If the value itself is an array, each item in that array will be appended to
21 the target array.
22
23 If a key name starts with ~, then the value will be inserted in an array.
24 See the + modifier for a description of how this works.
25
26 If the key name starts with -, then the value specifies the number of
27 entries to remove from the bottom or top of the array. Use negative numbers
28 to remove from the top of the array (shift), or positive numbers to
29 remove from the bottom of the array (pop).
30
31 If the value is set to ~~ then the key will be deleted from the Hash.
32
33 If the key is called 'INCLUDE', it will load the value as an additional file.
34 If the value is 'INCLUDE:filename' the file will be loaded into the key.
35
36 HashConfig::File
37
38 A simpler library than the above one. HashConfig::File is specifically for
39 loading configuration files (no strings, no merging) into a Hash.
40 It has load() and save() methods, and save() can optionally take a new
41 filename.
42
43 Author: Timothy Totten
44 License: Artistic License 2.0
45
Something went wrong with that request. Please try again.