File: README

package info (click to toggle)
libconfig-scoped-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 752 kB
  • ctags: 73
  • sloc: perl: 10,347; makefile: 42
file content (130 lines) | stat: -rw-r--r-- 3,343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
==============================================================================
                 Release of VERSION 0.12 of Config::Scoped
==============================================================================


NAME

    Config::Scoped - feature rich configuration file parser

ABSTRACT

    Config::Scoped is a configuration file parser for complex
    configuration files based on Parse::RecDescent. Files
    similar to the ISC named or ISC dhcpd configurations are
    possible. In order to be fast a precompiled
    grammar and optionally a config cache is used.


FEATURES

    Config::Scoped has the following highlights as a configuration file
    parser:

    * Complex recursive datastructures to any extent with scalars, lists and
      hashes as elements,

    * As a subset parses any complex Perl datastructures (no references and
      globs) without *do* or *require*,

    * Include files with recursion checks,

    * Controlled macro expansion in double quoted tokens,

    * Lexically scoped parameter assignments and pragma directives,

    * Perl quote like constructs to any extent, '', "", and here docs <<,

    * Perl code evaluation in Safe compartments,

    * Caching and restore with MD5 checks to determine alterations in the
      original config files,

    * Standard macro, parameter, declaration redefinition validation, may be
      overridden to validate on semantic knowledge,

    * Standard file permission and ownership safety validation, may be
      overridden,

    * Fine control for redefiniton warnings with pragma's and other safety
      checks,

    * Easy inheritable, may be subclassed to build parsers with specialized
      validation features,

    * Condoning syntax checker, semicolons and or commas are not always
      necessary to finish a statement or a list item if the end can be
      guessed by other means like newlines, closing brackets, braces etc.,

    * Well spotted messages for syntax errors even within include files with
      correct line numbers and file names,

    * Exception based error handling,

    * etc.,

PREREQUISITES

    Parse::RecDescent, Error

    Standard modules: 

        Carp          
        Storable        
        File::Spec 
        File::Basename
        Digest::MD5
        Safe           

APPETIZER

Configuration file example:

    # default parameters
    community = public;
    variables = [ ifInOctets, ifOutOctets ];
    oids = {
	ifInOctets  = 1.3.6.1.2.1.2.2.1.10;
	ifOutOctets = 1.3.6.1.2.1.2.2.1.16;
    };

    %warnings parameter off;    ### allow parameter redefinition

    # declarations
    devices rtr001 {
	ports = [ 1, 2, 8, 9 ];
    }

    devices rtr007 {
	community = 'really top secret!';
	ports = [ 1, 2, 3, 4 ];
    }


INSTALLATION

    It's all pure Perl.

    perl Makefile.PL
    make
    make test
    make install

AUTHOR

    Karl Gaissmaier (karl.gaissmaier at uni-ulm.de)


COPYRIGHT

     Copyright (c) 2004-2008, Karl Gaissmaier. All Rights Reserved.
     This program is free software; you can redistribute it and/or
     modify it under the same terms as Perl itself.

==============================================================================

AVAILABILITY

Config::Scoped has been uploaded to the CPAN

==============================================================================