in reply to Storing multiple blocks of text in the __DATA__ section

> Does anyone know of a Config:: module that would accept such syntax?

searching Config:: cpan produced some like Config::IniFiles , Config::Simple and Config::General .

It's always a question of which extra features you need or want to avoid.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

  • Comment on Re: Storing multiple blocks of text in the __DATA__ section

Replies are listed 'Best First'.
Re^2: Storing multiple blocks of text in the __DATA__ section
by blindluke (Hermit) on Jan 03, 2015 at 11:59 UTC

    I already use (and adore) Config::IniFiles, but it does not accept such simple syntax. It does, however accept multiline values for the params, but then the config would have to look like this:

    [general] Room=<<EOT A simple multiline text description EOT Wall=<<EOT Another multiline wall description With two paragraphs. EOT

    In recent versions of Config::IniFiles, you can specify a default section, so the first line of the above example could be omitted by doing:

    $cfg = Config::IniFiles->new( -file => *DATA, -default => "general" );

    Still, this is the same heredoc syntax which I was trying to avoid in the first place.

    Fortunately, gnosti has found the Data::Section::Simple module that seems to do exactly what I was searching for. His recommendation, and your excellent first reply, add to the reasons why I love our Monastery. Thank you.

    - Luke