I am using the Config::Scopped module as I wanted inheritance of variables from different scopes. The documentation on CPAN (http://cpan.uwinnipeg.ca/htdocs/Config-Scoped/Scoped.html#declarations)
states that "Blocks can be nested to any depth." I think I am missing something as I have the following data
# global scope
dist = "/archive/";
%warnings parameter off; ### allow parameter redefinition
aa1 {
environment = T;
aa2 {
Xlogin = "jimmy";
}
}
And it fails with the following error
Invalid decl item: Was expecting parameter or macro or comment or warn
+ing but found "aa2 {" instead at /home/.../XMLConfigs/e.cfg line 11.
I use the following code to read it
#!/usr/local/bin/perl -w
use strict;
use Config::Scoped;
use Data::Dumper;
my $parser = Config::Scoped->new( file => 'e.cfg' );
my $config = $parser->parse;
print Dumper($config);
Please let me know if I am doing something stupid or the module does not work as expected. Its version 1.31 (based on the top of the scoped.pm file) I think the latest on CPAN, I did an
install Config::Scoped about an hour ago. If the module is in a bad way can someone suggest a module which allows variables to be inherited and redefined in different scopes. Basically this module is what I need if I could get it to work :)
. This is perl, v5.6.1 built for i386-linux
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.