Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ajt (2546)

ajt
  (email not shown publicly)
http://www.iredale.net/

UK based. Perl, XML/HTTP, SAP, Debian hacker.

  • CPAN: ATRICKETT [cpan.org]
  • PerlMonks: ajt [perlmonks.org]
  • Local LUG: AdamTrickett [lug.org.uk]
  • Debian Administration: ajt [debian-adm...ration.org]
  • LinkedIn: drajt [linkedin.com]

Journal of ajt (2546)

Thursday January 15, 2004
03:45 PM

Old modules never die...

[ #16846 ]

A long time ago I wrote a configuration module in Perl. It was the first module I'd ever written, and I was happy with it. I never loaded it up to CPAN, partially because I wasn't confident enough, and partially because there is no shortage of Configuration reading modules on CPAN.

In the two years since, I've used the module quite a bit at home and at work. It's not great, but it does it's stuff, and it has proved reliable and useful. I'm starting a new project this year at work, and I will need a configuration module for it. I decided to dust off the old module and combine it with some more recent work I've done, and for the moment to remove the bits I never used in the original.

The new module is all nice and shiny, it's now an OO design, it has lots of tests (they all pass), and it preserves the best bits of the old module. I won't say it's perfect, but I'm happy with it, and it almost conforms to the coding standards we are now using at work. I've been doing my test to make small changes, run the tests, add more tests, make more small changes and so on. It's a really nice feeling to see "All tests successful." after each change!

Even though there is still no shortage of configuration readers on CPAN, I may upload this one, as it solves some unique problems I have. Though to be honest, I should also try and make some patches to ConfigReader::Simple which is the closest reader of those on CPAN I would want to use.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Patches (Score:3, Informative)

    Send the patches to me, too, since I'm comaintaining brian's modules, and his lag time can be pretty crappy over in Iraq.
    --

    --
    xoa

    • I did gather that brian was quite busy at the moment.... I've downloaded the module, and if I can figure out a sane way of adding the features I want, I'll send you the patches.

      The two things I want are:

      • Simple multi-line configuration.
      • Read the data in the callers __DATA__ section automatically.

      If I can put them in without perverting the current module, then I'd rather do that than re-invent another circular object...

      --
      -- "It's not magic, it's work..."
      • I'll see what I can do...
        --

        --
        xoa

        • Ta. I uploaded my module to CPAN yesterday, Config::Trivial [cpan.org], and then started on patching ConfigReader::Simple.

          I've not looked at changing the POD yet, but I've added the multi-line option, and updated the tests, and all seems well. I don't know if this breaks how some people have used the module in the past, but all the tests pass okay. If you are still interested, then I can do some more work and email you my version and the patch for you to look at.

          diff -bBdru ConfigReader-Simple-1.17/lib/ConfigReade

          --
          -- "It's not magic, it's work..."