On Sat, Jul 24, 2010 at 5:18 AM, Nick Fantes Huege
<nfhuege
AT
gmail.com> wrote:
When GT/Conf.pm reads the configuration file, it assumes that
statements that end in a backslash continue on the next line. It also
allows for inline comments behind a pound sign.
Currently multi-line statements have to have the \ symbol as their
very last character, otherwise they won't concatenate the next line.
So, for example if you have a couple of spaces after the ending \, it
won't work.
Similar problem with the inline comments. If you have a # Comment
right behind the \ sign, it won't work properly.
Attached is a fixed version of Conf.pm, with this and other minor
modifications. Here is also a Pastebin http://pastebin.com/XZvzWnjY
This module is completely backwards compatible with the old one.
The changes are:
1. Fixed multi-line statements with inline comments
2. Improved _get_home_path function (for Windows)
3. Added sub vars which returns a hash_ref to all config options.
Sometimes it's easier to use $conf->{'db::module'} instead
>::Conf::get('DB::module'), because the former can be interpolated
in strings.
4. Minor code reorders and improvements.
Note that I have removed all comments and pod from the module, because
for some reason they mess up my debugger.
If you find this patch to be useful, please feel free to add all the
commends and pod back.
Best regards,
Nick