John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

I have some content for a web site that is not really "dynamic", but can be changed via a form by the admin. For one, there's like 3 strings to fill in and they'll be short, as well as an image URL to provide. The site's template will just plug in the strings. So that could easily use the same config system I'm using already (config general), assuming it supports escaping out anything odd.

Another thing is a monthly news item. Old ones will be archived to a page that lists them all. So, append to it each time it is updated. This will be a whole paragraph, and might contain some html tags. Does Config::General have a "here document" concept?

Or, what would be a more suitable format to save these as text files? XML sounds like too much trouble, might clash with markup within the paragraph (especially if it contains errors!) and is also slow to read and parse back in when the page is generated. I'd like something light duty.

Any suggestions?

Replies are listed 'Best First'.
Re: Choosing a format to save some data
by repellent (Priest) on Mar 22, 2011 at 07:25 UTC
      Or, what would be a more suitable format to save these as text files? ... I'd like something light duty.

    Uhm... how about a plain text file?

    Keep it line-oriented (first 4 lines for settings, the rest for news items), and then use local $/ = "__END_OF_HEREDOC__\n".
Re: Choosing a format to save some data
by Anonymous Monk on Mar 22, 2011 at 07:23 UTC
Re: Choosing a format to save some data
by GrandFather (Saint) on Mar 22, 2011 at 22:43 UTC

    Sounds like a case for a small SQLite database.

    True laziness is hard work