Thanks for your answer. I don't want the comments, I actually want to get rid of them. I tested with Config::General and is interesting, but the problem is that when I have the sub-structures, the lib just put everything together and I can't split or find the parents of each key-value...
That's my test-code:
#!/usr/bin/perl
use warnings;
use strict;
use Config::General;
my $conf = Config::General->new("fh.cfg");
my %config = $conf->getall;
my @myarray = ();
while( my( $key, $value ) = each %config ){
print "$key: $value\n";
if (ref($value) eq 'ARRAY'){
@myarray = @$value;
foreach (@myarray) {
print "$_\n";
}
}
}
And here is the output repeated (because "request_snapshot" appears many times in my config):
(...)
status_interval: 30;
exchange_is_active_time_end: "16:00";
dropout_detection_initial_interval_secs: 600;
request_snapshot: ARRAY(0xce97a8)
false;
false;
false;
false;
(...)
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.