I'm looking for an ultra-simple way to write a persistent CGI script, which could be used for example to implement a small web forum, or an adress book etc.

I'd like it to work "out of the box" with a recent version of Perl, on most any platform, with any web server, and without needing the installation of any additional Perl modules or any other software (e.g. an RDBMS). Please tell me if this is unWise, or if there's a clever way to do it.

I'm thinking of something very very simple for very small amounts of data, a coarsely persistent CGI program that might run like so :

1. Load all data from a file using perlman:Data::Dumper
2. Manipulate data (consult, insert, update, delete)
3. Save all data to a (locked) file using Data::Dumper
The locking/unlocking mechanism might need to be platform-dependent, since perlfunc:flock doesn't work everywhere.

Why do I want to do such an obviously non-scalable thing? Hopefully this would be in the spirit of quick-and-dirty, portable, concise, and useful Perl programs. I've done plenty of Perl DBI, Java/JDBC, etc., but here I'm looking for something simple and easy.

There didn't seem to be anything relevant in CGI Programming.


In reply to Simplest CGI Persistence Solution? by Tortue

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.