Looking at the code again, I noticed you had (comments removed):

my $q = new CGI; my $action = $q->param('action'); my $month = param('month'); my $date = param('date'); my $year = param('year'); my $title = param('title'); my $message = param('message'); my $placement = param('placement');

I believe the issue is that you're retrieving them as my $variable = param('key'); when you should have it (I believe) as my $variable = $q->param('key'); for those lines. Try that, and see if it might take care of the issue for you. Just a thought.

Update (19 Oct 2002): In attempting to run the script from the command-line to figure out what else might be wrong, I received an error message about $placement not being defined, using the code you posted above. Did you leave out the code that set the value for that? Testing from the command line (-debug option required for this in the use statement for some versions of CGI.pm), when action was passed as 'add_event', what was written to the file was what I handed it for all of the other values. Are you seeing any error messages in your logs?

Update (19 Oct 2002): Something else I'm goig to ask just to ask, but I didn't see the elements you were passing in the form in the posting. Did you remove the <input> tags from the sample form? Those tags would have to appear between the <form></form> elements... Just thought I would ask...


In reply to Re^2: saving data problem by atcroft
in thread saving data problem by cal

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.