Config::Magic .72 released

From: Rusty Phillips (rustyp_at_freeshell.org)
Date: 06/23/04

  • Next message: Rusty Phillips: "Re: math::trulyrandom"
    Date: Wed, 23 Jun 2004 02:10:04 GMT
    
    

    New module now available on CPAN for reading all kinds of
    configuration files. .7 was just added to CPAN. .72 should enter
    shortly, as it was uploaded a few hours ago. The difference is a fix of
    some problems with the POD at the end of the module - none of the actual
    mechanics of the module were changed.

    The modules reads configuration files/strings and converts them into hash
    references. It is capable of reading pretty much any kind of standard
    config file - XML, CSV, apache, INI files, space separated, equals
    separated, and many more. It can even read hybrids. Here's an example of
    what the module is capable of:
    Input file:

    Section 1 {
    [Section 4]
    #Comment Style 1
    \\Comment Style 2
    ; Comment Style 3
    Monkey:1
    Monkey=>2
    Monkey:=3
    Monkey 4
    <Section 2>
    Foo = Bar
    Baz { Bip:1
    Pants=5 }
    </Section>
    <Tasty Cheese="3" />
    <Section 5>
    Foo=Bippity,boppity,boo
    </Section>
    }

    Output (from Data::Dumper)

    $VAR1 = {
              'Section 1' => {
                               'Tasty' => {
                                            'Cheese' => {}
                                          },
                               'Section' => [
                                              {
                                                'Foo ' => 'Bar',
                                                'Baz' => {
                                                           'Bip' => '1',
                                                           'Pants' => '5'
                                                         },
                                                '2' => {}
                                              },
                                              {
                                                'Foo' => [
                                                           'Bippity',
                                                           'boppity',
                                                           'boo'
                                                         ],
                                                '5' => {}
                                              }
                                            ],
                               'Section 4' => {
                                                 'Monkey' => [
                                                               '1',
                                                               '2',
                                                               '3',
                                                               '4'
                                                             ]
                                               }
                             }
            };

    Feedback is greatly appreciated.


  • Next message: Rusty Phillips: "Re: math::trulyrandom"

    Relevant Pages

    • Re: security thing
      ... possibly change system directories and configuration files. ... Changing one's password requires writing to a system configuration ... PTM: You are right, if this kind of interaction is made thru the tools which are in use today. ... but by reading smb.conf she gets a lot of information about the setup of the computer. ...
      (alt.os.linux)
    • Re: whihc Linux distro for experienced Linux user?
      ... i also used 3 BSDs for some time & ... installed/used them myself only by reading man pages :-) now i feel ... irritated by "configuration using GUIs" as they hide the complexity. ... configure configuration files. ...
      (alt.os.linux)
    • online_update configuration file problems
      ... My YaST2 has problems in reading the patch list. ... The online_update configuration files have conflicting instructions, ... which messes up the network search. ...
      (alt.os.linux.suse)
    • Re: I am having the same problem!
      ... ShadowAssassin wrote: ... my application is reading tnsnames.ora etc and everything ... I asked for configuration files, not trace files. ...
      (comp.databases.oracle.server)
    • Re: Configuration Files
      ... > I'm interested in creating a large number of configuration files which I ... > have no experience doing in python. ... XML is verbose. ... is that there are tools for dealing with XML sanely - XML editors, ...
      (comp.lang.python)