in reply to Config::Simple with vars method
output:#!/usr/bin/perl -w use Config::Simple; use strict; use Data::Dumper; my $cfg; my %config; $cfg = new Config::Simple('test.cfg'); open(FH,"test.cfg"); printf("'%s' syntax\n", $cfg->guess_syntax(\*FH)); close FH; %config = $cfg->vars(); print Dumper(\%config); exit; D:\PerlProjects\tests>c.pl
Now the reason for it (from a cursory reading of the Config::Simple manpage):'ini' syntax $VAR1 = { 'default.NET' => 'X' };
Since your config file does not have any block delimiters (indicated by brackets), the values are assigned to the 'default' block.[block1] key=value
generates the following output:[info] NET=X
I would suggest you perldoc Config::Simple to learn more about the module.D:\PerlProjects\tests>c.pl 'ini' syntax $VAR1 = { 'info.NET' => 'X' };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Config::Simple with vars method
by Anonymous Monk on Jul 06, 2004 at 05:06 UTC | |
by davidj (Priest) on Jul 06, 2004 at 05:16 UTC |