On Thu, Sep 19, 2002 at 04:36:03AM -0700, Praveen wrote:
> Can anyone give an example how to read the
> configuration file(environment variable file) using
> perl, I was reading the AppConfig documentation, and I
> tried, its not working.
> 
> for e.g., I have a file called gouenv
> in that I declared variables
> [ ... ]

Please give a small (tested) code sample of what you did and what happened.

If the file "foo.txt" contains the single line "bar = baz" then this code will
print "baz":

        /usr/bin/perl

        use AppConfig;

        my $bar;

        my $config = AppConfig->new();

        $config->define('bar' => { ARGCOUNT => ARGCOUNT_ONE });

        $config->file("foo.txt");
        print $config->get('bar'); print "\n";

Does that work?

What part gives you trouble?

-- 
rjbs

Attachment: msg09118/pgp00000.pgp
Description: PGP signature

Reply via email to