Bod has asked for the wisdom of the Perl Monks concerning the following question:
I need to create some configuration files on a server that will be pulled down by a client application - the remote config file. The client application will also have its own local config file.
In the past I would have just hard coded the logic for reading/writing the config files into the program on both the the client and the server which could create a mismatch if this code is ever updated in the future. Being led in the ways of well-written, easy to maintain code by the esteemed Monks of the Monastery, I am going to write this code as a module that can be installed on both the client and the server. That way, provided both are using the same version of the module, no mismatch will be possible. The first step was to search CPAN for suitable modules. I didn't expect to find anything that fitted the task perfectly but I did find a few possible candidates of which the top choice would be Config::Simple.
I don't need blocks so want what this module calls a SIMPLIFIED INI-FILE. There are two bits of functionality missing from this module that I need:
But this is not a one off situation...how do you decide between extending a class by including that class in @ISA or bringing the class into your class with the use statement and having your module call its methods? Some cases seem clear cut but there is a lot of middle ground where the answer is not clear to me.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: To Extend, to Use, to Create
by stevieb (Canon) on Dec 06, 2020 at 17:56 UTC | |
Re: To Extend, to Use, to Create
by karlgoethebier (Abbot) on Dec 07, 2020 at 13:30 UTC | |
by Fletch (Bishop) on Dec 07, 2020 at 19:11 UTC | |
by karlgoethebier (Abbot) on Dec 08, 2020 at 07:32 UTC | |
by Bod (Parson) on Dec 07, 2020 at 22:22 UTC | |
Re: To Extend, to Use, to Create
by perlfan (Parson) on Dec 07, 2020 at 20:03 UTC | |
by Bod (Parson) on Dec 07, 2020 at 20:59 UTC |