Real Perl has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I have to create a file that will hold some default values -- reflected on my GUIs at the time the user runs the program. The user has to be able to change the defaults--I'll have a button that allows this to happen-- and when the user runs the program again, the last saved defaults should show up.
I looked at the Config::Abstract::Ini on the CPAN and different other modules, but this is not making sense in what I concretely need to do to solve this problem.
At this point, any pointers would be great.

Thank you and I'm very much looking forward to reading your reply,

Claire

Replies are listed 'Best First'.
Re: .ini file
by Zaxo (Archbishop) on Jul 30, 2005 at 19:47 UTC

    Config::IniHash might do what you want, concretely.

    If you are not committed to .ini style, consider YAML.

    After Compline,
    Zaxo

        Dear GrandFather and other Monks,

        Thank you
        I got XML::Simple module to work however, I am concerned that I cannot use use strict; any more. What kind of risk can my program have?

        Thanks in advance for your time,
        Claire

      I don't understand why once I try to run the .pl file that has either of those:

      #use Config::Tiny; #use Config::Simple; use Config::IniHash;

      I tried all of those modules separately but I am always getting : Can't locate Config/Tiny.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib.) at file.pl line 4
      BEGIN failed --compilation aborted at file.pl line 4.

      Any idea would be most appreciated.

      Thanks,


      Claire
        That error message means you have to *install* the module. See CPAN.pm, cpan or ppm as you prefer.
Re: .ini file
by InfiniteLoop (Hermit) on Jul 30, 2005 at 19:44 UTC
Re: .ini file
by GrandFather (Saint) on Jul 30, 2005 at 22:45 UTC
Re: .ini file
by davidrw (Prior) on Jul 31, 2005 at 00:44 UTC
    Also take a look at AppConfig (quick example usage here).. among many formats, it can work with filest that look like a .ini .. also just a general search for config seems promising.
Re: .ini file
by jimX11 (Friar) on Jul 31, 2005 at 13:47 UTC

    Merlyn mentions Config::Scoped in an article about config files.

    The article content "is embargoed until 00:00:00 01-Aug-2005 per publisher's agreement."