Hi,
I'm having trouble with the above module/method.
Here is the header from the module:

package Config::Simple; # $Id: Simple.pm,v 3.50 2003/04/29 01:42:25 sherzodr Exp $ use strict; # uncomment the following line while debugging. Otherwise, # it's too slow for production environment #use diagnostics; use Carp; use Fcntl qw(:DEFAULT :flock); use Text::ParseWords 'parse_line'; use vars qw($VERSION $DEFAULTNS $LC $USEQQ $errstr); use AutoLoader 'AUTOLOAD'; $VERSION = '4.55'; $DEFAULTNS = 'default';

I'm confused as to the ver num, it seems to be 3.50 and 4.55 ???

My code is this:

#!/usr/bin/perl -w + use Config::Simple; use strict; + + 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 "NET = $config{NET} \n"; exit;

and my cfg file is a 1 liner (for test purposes):

NET = X

The output is:

'ini' syntax Use of uninitialized value in concatenation (.) or string at ./t2.pl l +ine 14. NET =

which is odd because it should be 'simple' syntax according to the CPAN page http://search.cpan.org/~sherzodr/Config-Simple-4.55/Simple.pm

More importantly, it doesn't return the cfg file value. I've had a look through google and here (perlmonks) but can't find the problem mentioned. Maybe it's just me.... Any help appreciated.
I'd really like to use the hash syntax, because it's simpler/less 'noisy' than the other options.

Cheers
Chris
PS Supplementary dumb qn: why do i have to use HTML tags writing my qn. Why won't it accept CR/LF chars as in normal text?


In reply to Config::Simple with vars method by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.