Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to modify this to read multiple config files as follows:my $SETS = Config::Auto::parse( '/path/file.conf' ); print Dumper( $SETS ); $VAR = { 'entryA' => { anonymous hash } 'entryB' => { anonymous hash } };
Obviously only the last entry ends up in $SETS. Is there an elegant way to achieve the above. There seems to be plenty of documentation on how to achieve this for hashes, arrays, or even arrays of references but just not the above. (It is also quite possible that I do not really understand what exactly I am dealing with as I am not really a programmer.)my @files = </path/to/files/*>; my $SETS = Config::Auto::parse( $_ ) foreach @files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: combining multiple hashrefs
by clinton (Priest) on Jul 09, 2007 at 09:47 UTC | |
by patrickb (Initiate) on Jul 26, 2007 at 23:45 UTC | |
|
Re: combining multiple hashrefs
by varian (Chaplain) on Jul 09, 2007 at 06:28 UTC | |
by patrickb (Initiate) on Jul 26, 2007 at 23:43 UTC | |
|
Re: combining multiple hashrefs
by EvanCarroll (Chaplain) on Jul 09, 2007 at 05:45 UTC |