Req advice on new module to be uploaded: Config::Magic?

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

  • Next message: Jürgen Exner: "Re: Nested hash conversion to HTML"
    Date: Sat, 19 Jun 2004 06:01:48 -0500
    
    

    Hello,
    I'm new to developing perl modules for CPAN, but I just finished a
    lot of work on something I think others will find useful.

    Basically, what it does is parse almost any kind of config file
    and convert it into a hash tree. It uses Parse::RecDescent, and
    the "language" it recognizes is a superset of most other config
    files. Because it has no configuration options, and is just supposed
    to work, I was thinking of calling it Config::Magic.

    I thought I'd check in here first to get feedback before I upload.
    I've already registered at PAUSE.

    Just to give the idea of what this does, here's an example input:
    Section 1 {
    [Section 4 ]
    #Comment Style 1
    \\Comment Style 2
    ; Comment Style 3
    Monkey:1
    Monkey=>2
    Monkey:=3
    <Section 2>
    Foo = Bar
    Baz { Bip:1
    Pants=5 }
    </Section>
    <Tasty Cheese="3" />
    <Section 5>
    Foo=Bippity,boppity,boo
    </Section>
    }
    And here's the corresponding output (inspecting the generated hash
    reference with Data::Dumper:
    $VAR1 = {
              'Section 1' => {
                               'Tasty' => {
                                            'Cheese' => '3'
                                          },
                               'Section' => [
                                              {
                                                'Foo ' => 'Bar',
                                                'Baz' => {
                                                           'Bip' => '1',
                                                           'Pants' => '5'
                                                         },
                                                '2' => {}
                                              },
                                              {
                                                'Foo' => [
                                                           'Bippity',
                                                           'boppity',
                                                           'boo'
                                                         ],
                                                '5' => {}
                                              }
                                            ],
                               'Section 4 ' => {
                                                 'Monkey' => [
                                                               '1',
                                                               '2',
                                                               '3'
                                                             ]
                                               }
                             }
            };

    So my questions are:
    1) Do you think the name is appropriate and searchable? If not, do
    you have any suggestions?
    2) Does anyone else know of any all-encompassing config modules
    like this? I couldn't find any, but there's a lot of stuff in CPAN
    (Config::Auto does not have this degree of flexibility)
    3) Anyone here interested in giving it a try (I'll announce on
    comp.lang.perl.announce when it's uploaded)?

    Let me know shortly if you would. Thanks!

    Rusty Phillips


  • Next message: Jürgen Exner: "Re: Nested hash conversion to HTML"

    Relevant Pages

    • interactive text menu configuration module
      ... I have been looking through CPAN and I cant seem to find a module to ... None of the modules under config seem to have any ... interactivity or anything. ... Know of any on CPAN? ...
      (comp.lang.perl.misc)
    • Using CPAN "lightweight"
      ... Is there a way to use the CPAN module *without* its creating a directory ... and doing all sorts of fancy initialization and such? ... I just tried and when it can't find a $HOME/.cpan dir with its config info ...
      (comp.lang.perl.misc)
    • Re: Removing .cpan Directory
      ... is that .cpan directory in my home directory. ... If you don't run CPAN as root, then the config params are stored in .cpan/ ... you limit root authority to just the final "sudo make install". ...
      (comp.lang.perl.misc)
    • Re: Removing .cpan Directory
      ... is that .cpan directory in my home directory. ... If you don't run CPAN as root, then the config params are stored in .cpan/ ...
      (comp.lang.perl.misc)