in reply to Config::IniHash heredoc errors.

$options-> is a reference. It referes to something (it doesn't matter what for the moment). When you write my $options you have not given $options a value, it is undef. -> doesn't work with an undefined value. You could do this:

my $options = {}; $options->{'heredoc'} = '1';

Which sets $options to refer to an empty hash, then assignes a key/value pair to the hash

However, looking at the code in context what you really want is:

my %options; $options{'heredoc'} = '1'; my $config_copy = ReadINI ($copy,%options);

The dereference operator is completely bogus in this context.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Config::IniHash heredoc errors.
by hesco (Deacon) on Dec 01, 2005 at 08:03 UTC
    Thank you sir.

    That clarification; and dropping the oo -> notation got me past the compile time errors, to a webpage which failed to produce the anticipated result.

    Now I think I need to dig further into the Config::IniHash docs to figure out why my heredoc configuration variables are not being populated and / or passed.

    -- hugh

Re^2: Config::IniHash heredoc errors.
by hesco (Deacon) on Dec 02, 2005 at 18:28 UTC
    OK. I've made multiple attempts at this one, setting $config{heredoc} = 1; = 'ON'; = 'on'; etc. But I can not seem to get this feature of this module to work for me.

    An important element of my application's configuration scheme is to pull client specific copy out of domain-specific configuration files and to use it to decorate otherwise stock web forms.

    Does anyone here have any experience successfully using this feature. Can you please share with me a snippet of working code from your script which uses Config::IniHash as well as the .ini file itself?

    I would certainly appreciate having a working model to work from. And would love to shift maintainance of the configuration module from our project to a module with broader applicability.

    -- Hugh