in reply to Re: Config::Simple with vars method
in thread Config::Simple with vars method

David,
I follow your info, but the CPAN page says: Quote
Return value is one of "ini", "simple" or "http".
Unquote
when mentioning the 'guess_syntax' method. As my file is simple, it should recognise it as such.
It also shows what code to use for 'simple' and 'ini' style files: Quote
my %Config = $cfg->vars(); print "Username: $Config{User}"; # If it was a traditional ini-file: print "Username: $Config{'mysql.user'}";
where the first is for 'simple' files, which I want to use.
Cheers
Chris

Replies are listed 'Best First'.
Re^3: Config::Simple with vars method
by davidj (Priest) on Jul 06, 2004 at 05:16 UTC
    Chris,
    I think you need to read the documentation a little more closely. It reads:

    SIMPLE CONFIGURATION FILE

    "Simple syntax is what you need for most of your projects. These are, as the name asserts, the simplest. File consists of key/value pairs, delimited by nothing but white space."

    INI-FILE

    "These configuration files are more native to Win32 systems. Data is organized in blocks. Each key/value pair is delimited with an equal (=) sign. Blocks are declared on their own lines enclosed in (brackets):"

    Your not providing blocks does not make it a 'simple' file. The fact that you are using '=' as a key/value delimiter does make it an 'ini' file. If you want to use 'simple', the replace the '=' with whitespace.

    davidj