Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Config managers

by jdtoronto (Prior)
on Aug 29, 2003 at 19:57 UTC ( [id://287821]=perlquestion: print w/replies, xml ) Need Help??

jdtoronto has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed Monks,

I have been looking at CONFIG modules it seems like for weeks! When I find one I like it is not available from ActiveState.

So, my question is - I need a config manager that can store hashes and arrays within the config. It must have named sections. I like Config-General. Are there any other monks using this with AS 5.8.0 on Windows (I am using XP)? If so can you give me some clues on any problems you had making/installing the module?

Also, as a neophyte when it comes to modules, how do I tell if a module is pure-perl or if it has XS in it?

jdtoronto

Replies are listed 'Best First'.
Re: Config managers
by tcf22 (Priest) on Aug 29, 2003 at 20:05 UTC
    One option is to use one of the XML::* modules and just write an XML document to store your data.

    Another option, which is probably the easiest, is to use Data::Dumper, and print the structure to a file. Then when you read it back in, just store it in a var and eval it. Just be careful, since you are evalling, to check the content for system, exec, backticks, etc., to make sure it hasn't been tampered with.

    Update:
    I checked ActiveState for Config::General, and the reason you can't get it for Win32, is because it failed compilation. Take a look here for a list of Config::* modules that have compiled on Win32.
Re: Config managers
by bobn (Chaplain) on Aug 30, 2003 at 02:50 UTC

    Storable.pm is available on Activestate, with the added advantage that you don't eval anything to get it back.

    --Bob Niederman, http://bob-n.com

    All code given here is UNTESTED unless otherwise stated.

Re: Config managers
by PodMaster (Abbot) on Aug 30, 2003 at 08:42 UTC
    Tutorials -> A Guide to Installing Modules

    `perldoc perlmodinstall'

    A non-pure-perl module has files that end in .xs, .c, .h, .y, .cc, .cxx, or .C, and the INSTALL file generally reflects that it requires a compiler and/or external libraries (like libxml2...).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      This is a good last resort.

      I've found that PPM is superior for Windows installations since it automatically adds a module's HTML documentation to ActivePerl's set of documentation (HTML files). I'm sure that this can be done manually, but I haven't spent the time to figure it out.

      Are there instructions available for creating HTML pages from a module's POD and then linking it into ActivePerl's documentation?

      Also, what other things does PPM handle that is specific for ActivePerl? I've noticed something about PPM3 registering installed modules with ActiveState.

        Are there instructions available for creating HTML pages from a module's POD and then linking it into ActivePerl's documentation?
        At first I used to use ActivePerl::DocTools. Soon after I wrote ActivePerl::DocTools::TOC::HTML::Podmaster. Around that time ActiveState started removing the pod from all the ActivePerl::* modules. I didn't like that very much, so I wrote Pod::Master. I now use Pod::Master exclusively.
        Also, what other things does PPM handle that is specific for ActivePerl? I've noticed something about PPM3 registering installed modules with ActiveState.
        I haven't seen anything about that, but then I don't have an ActiveState account, or buy any of ActiveStates producs (I get the free stuff). What you're describing are ActiveState Developer profiles (or something like that). I don't use that feature (apparently if you use ActiveState flavored TCL, Python ... you can also use PPM to manage those, but I don't use TCL, and I don't use ActiveState flavored Python).

        update: if you don't bother to look at ActivePerl::DocTools::TOC::HTML::Podmaster, or look inside ActivePerl::DocTools, how you (or PPM for that matter) update the html is

        perl -MActivePerl::DocTools -e UpdateHTML()
        That's basically what PPM does after you use it to install a module.

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://287821]
Approved by tcf22
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-23 07:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found