Skip to content
100644 46 lines (31 sloc) 1.68 KB
454da90 @supernovus Perlite::Data becomes HashConfig::Magic, added HashConfig::File.
1 HashConfig
2 -----------
4 A couple of libraries for representing configuration data as a Hash.
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.
10 HashConfig::Magic
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.
16 It defines special key names and values for dealing with merging data.
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.
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.
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).
31 If the value is set to ~~ then the key will be deleted from the Hash.
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.
36 HashConfig::File
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.
43 Author: Timothy Totten
44 License: Artistic License 2.0
Something went wrong with that request. Please try again.